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

John Colvin john.loughran.colvin at gmail.com
Sat Apr 3 10:54:54 UTC 2021


On Saturday, 3 April 2021 at 09:09:33 UTC, Guillaume Piolat wrote:
> On Friday, 2 April 2021 at 20:56:04 UTC, Walter Bright wrote:
>>
>> I'm not preventing anyone from adding integer overflow 
>> detection to D. Feel free to make a prototype and we can all 
>> evaluate it.
>
> Seems to be a bit like bounds checks (less obvious benefits), 
> it could be made default but disabled in -b release-nobounds
>
> Even while being opt-out, bounds check are annoying in D 
> because with DUB you typically profile a program built with dub 
> -b release-debug and that _includes_ bounds checks! So I 
> routinely profile programs that aren't like the actual output.
>
> So, integer overflow checks would - in practice - further 
> hinder capacity to profile programs.

It’s not like bounds checks because there’s loads of code out 
there that correctly uses overflow. It’s a significant breaking 
change to turn that switch on, not just a “would you like to 
trade some speed for safety” like bounds-checks are.

That’s not to say it shouldn’t be done. I’m just pointing out 
that it’s very different.


More information about the Digitalmars-d mailing list