
On Mon, Aug 18, 2008 at 04:03:06PM +0300, dizzy wrote:
Checked integer types are useful for debug builds. The runtime cost is not that heavy, usually on overflow a register flag is set (in some cases even an interrupt) so a simple assembler jmp handle this. But again.. only for debug/special builds since we all know that there is a runtime overhead.
That I completely agree. One of the main reasons I love using stdlib is that I can compile it in debug mode and have all iterators, dereferences checked. But we can't ask from the standard to offer such checked native integers only in debug more or something :)
I wish that the standard defined a set of standard debugging / diagnostic / safety facilities that would behave identically on all platforms. You like having debug STL. I'd like to have a debug / defined version of integers. Why do you think that it's wrong to define those things in the standard as an _option_ ? Do you mind that div() and ldiv() functions are standardized[*]? If not, why would you mind having defined minimal requirements for safe integers, safe iterators, etc? [*] These two functions are specifically provided to provide platform-independent rounding in integer division. So the precedent already exists.