Time to move std.experimental.checkedint to std.checkedint ?
Walter Bright
newshound2 at digitalmars.com
Wed Mar 31 05:32:16 UTC 2021
On 3/30/2021 10:16 PM, Vladimir Panteleev wrote:
> 1. The compiler (whether it's the Zig frontend or the LLVM backend) is smart
> about adding the checks. If it can prove that the values will never overflow,
> then the overflow checks aren't emitted. I had to trick it into thinking that
> they may overflow, when in practice they never will.
The code uses hardcoded loop limits. Yes, the compiler can infer no overflow by
knowing the limits of the value. In my experience, I rarely loop for a hardcoded
number of times.
More information about the Digitalmars-d
mailing list