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

Reply via email to