On 12/14/2015 01:27 PM, tsbockman via Digitalmars-d wrote:
On Sunday, 13 December 2015 at 11:25:37 UTC, Ola Fosheim Grøstad wrote:
On Sunday, 13 December 2015 at 11:18:31 UTC, Robert burner Schadek
wrote:
On Saturday, 12 December 2015 at 22:57:55 UTC, Ola Fosheim Grøstad
wrote:
2. Debug-mode testing of integer overflow.
https://github.com/D-Programming-Language/phobos/pull/3389
I know, but that does not help when one are debugging code that
doesn't use it.
I have spent a lot of time trying to design the best checked integer
type possible for Phobos, and I intend to finish the job (hopefully
soon).
Nevertheless, I fully agree with Ola: compiler support (similar to how
array bounds checking is handled already) would be much better than
any library solution could be. Doing it right would also be a
fundamental breaking change, though, so this will have to wait for a
hypothetical D3.
It wouldn't need to be a breaking change if checked integer were a
separate type series, as the unsigned series is. The types could be
called "cint" etc. I expect that they would incur significant overhead,
as I don't think there is hardware support for checked integers, and as
such the current types would need to be maintained.