Hello, I'm wondering: Does Boost have a class like Microsoft's SafeInt? (Portable, of course.) If not: Does anyone have some good guidelines on how to make code (on Linux) integer overflow safe? (Here: Safe == exception generating.) I'm thinking specialized compilers, etc. -- Regards, Troels Arvin <troels@arvin.dk> http://troels.arvin.dk/
Troels Arvin wrote:
Hello,
I'm wondering: Does Boost have a class like Microsoft's SafeInt? (Portable, of course.)
If not: Does anyone have some good guidelines on how to make code (on Linux) integer overflow safe? (Here: Safe == exception generating.) I'm thinking specialized compilers, etc.
http://www.boost.org/libs/numeric/conversion/doc/numeric_cast.html
On Mon, 30 Oct 2006 15:38:50 -0800, Delfin Rojas wrote:
I'm wondering: Does Boost have a class like Microsoft's SafeInt? (Portable, of course.)
If not: Does anyone have some good guidelines on how to make code (on Linux) integer overflow safe? (Here: Safe == exception generating.) I'm thinking specialized compilers, etc.
http://www.boost.org/libs/numeric/conversion/doc/numeric_cast.html
So the answer to my first question is that there is no SafeInt-like class in Boost? About the link to numeric_cast: But that doesn't catch cases where -e.g.- an integer is incremented beyond its limit (overflowing), right? -- Regards, Troels Arvin <troels@arvin.dk> http://troels.arvin.dk/
participants (2)
-
Delfin Rojas
-
Troels Arvin