Error with implicit cast of ^^=

Ali Çehreli acehreli at yahoo.com
Wed Jul 14 17:29:04 UTC 2021


On 7/14/21 2:44 AM, wjoe wrote:

 >>   x = (x ^^ y).to!(typeof(x));
 >> }
 >>
 >> For example, run-time error if y == 7.

 > I was planning on adding support for over-/underflow bits but this is
 > much better. Thanks!

If so, then there is also std.experimental.checkedint:

   https://dlang.org/phobos/std_experimental_checkedint.html

Andrei Alexandrescu introduced it in this presentation:

   https://dconf.org/2017/talks/alexandrescu.html

Ali



More information about the Digitalmars-d-learn mailing list