Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2006-09-11 03:11:13


I recently wrote a proposal:
http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?SecureIntegerOperations

>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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk