3 ms·
Similarly, with C#, you can compile with exception-on-overflow for integers. This is all great, but this should really be the default behavior for basic arithme
by int_19h 3y ago
Similarly, with C#, you can compile with exception-on-overflow for integers. This is all great, but this should really be the default behavior for basic arithmetic operators, even in release builds. For cases where you want overflow (or saturation, or UB) there should really be distinct operators. Maybe something like <+> for wraparound, [+] for saturation etc.