Time to move std.experimental.checkedint to std.checkedint ?

sighoya sighoya at gmail.com
Mon Mar 29 11:44:18 UTC 2021


On Saturday, 27 March 2021 at 03:25:04 UTC, Walter Bright wrote:

> 4. fast integer arithmetic is fundamental to fast code, not a 
> mere micro-optimization. Who wants an overflow check on every 
> pointer increment?

The point is the overflow check is already done by most cpus 
independent if overflow will be handled by the language or not.
Unfortunately, such cpu's don't send an interrupt, so we have to 
check twice for overflows.
The best is of course to handle the language safe arithmetics, 
however this requires full semantic support in the type system.
What about providing two operators for integer arithmetic 
instead, one safe and one unsafe?


More information about the Digitalmars-d mailing list