
11 Sep
2006
11 Sep
'06
7:11 a.m.
I recently wrote a proposal: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?SecureInteger...
Does boost have anything like this?
// Returns whether an operation will go out of bounds // given the values which will be passed to that operation template <typename Type> struct overflow_traits { bool neg(const Type & val); bool add(const Type & lhs, const Type & rhs); bool sub(const Type & lhs, const Type & rhs); bool mul(const Type & lhs, const Type & rhs); bool div(const Type & lhs, const Type & rhs); bool mod(const Type & lhs, const Type & rhs); //... };
-- Alexander Nasonov