core.checkedint added to druntime
"Nordlöw" via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Sun Jun 22 00:37:58 PDT 2014
> While being a very modest piece of code in and of itself, I
> believe this offers a significant opportunity that both D
> compilers and user defined types can exploit.
I did this in C/C++ a while ago, out of which I have forgotten
most of it :)
https://github.com/nordlow/justcxx/blob/master/sadd.h
https://github.com/nordlow/justcxx/blob/master/ssub.h
https://github.com/nordlow/justcxx/blob/master/smul.h
Tests are here:
https://github.com/nordlow/justcxx/blob/master/t_ranged_and_saturated.cpp
Maybe there's something more here that could give further ideas.
Pick what you want.
More information about the Digitalmars-d-announce
mailing list