On Sunday, 26 February 2017 at 09:41:46 UTC, rumbu wrote:
On Saturday, 25 February 2017 at 15:21:10 UTC, Andrei
Alexandrescu wrote:
On 02/25/2017 10:17 AM, rumbu wrote:
A lot of bloat code for something extremely basic.
If you can do it with less code, I'm all ears. Thanks! --
Andrei
This was not about coding skills, was about usability. The
module contains too many options and failure scenarios instead
of a simple default behavior.
Considering that in most languages with integrated overflow
checking, the default behavior is throwing some kind of
exception (Ada, C#, Pascal, Rust, Swift)
If you want a module with a lot less features, the low-level
core.checkedint might be interesting for you:
http://dlang.org/phobos/core_checkedint.html
this one must be at least [be] highlighted at the top of the
documentation.
It is now:
http://dlang.org/phobos-prerelease/std_experimental_checkedint.html
If this is still unclear, please submit a PR to improve the docs!
;-)