The case for integer overflow checks?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Mon Sep 18 08:27:21 UTC 2017


On Friday, September 15, 2017 19:01:18 Walter Bright via Digitalmars-d 
wrote:
> On 9/15/2017 5:00 PM, bitwise wrote:
> > On Friday, 15 September 2017 at 21:21:01 UTC, Walter Bright wrote:
> >> https://dlang.org/phobos/std_experimental_checkedint.html
> >
> > Will this ever be integrated directly into the compiler?
>
> No plans to do so.

There also really isn't a need to do so. If you care about having the
overflow checks, then you use Checked. If you don't, you don't. And from
what I recall of Andrei's talk on it, Checked is insanely customizable -
which a built-in feature wouldn't be.

Personally, I've never had a need for checked ints. I've rarely seen code
that would care, and when you do, it's usually pretty easy to deal with it
properly. But Checked is there for those who feel the need.

- Jonathan M Davis



More information about the Digitalmars-d mailing list