Boost logo

Boost :

From: Jason Hise (0xchaos_at_[hidden])
Date: 2006-09-10 20:29:46


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);
    //...
};


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