
On Tue, Feb 21, 2012 at 9:18 AM, Antony Polukhin <antoshkka@gmail.com>wrote:
2012/2/21 Ben Robinson <cppmaven@gmail.com>:
The implementation is fully portable, and it provides integer types which can be used like the builtin integers, except they will trigger their policy on an overflow.
Great! Overflow detections are widely used in Boost.Lexical_cast library, but the implementation is not generic. I would very appreciate a header only library for detecting overflows.
Well now you have it! :)
How fast is your library? Does it support unsigned long long int overflow detection?
The library is meta-programmed with respect to the data types involved in each overloaded math operation, taking advantage is performance savings, such as when both data types are unsigned (see my more complete performance response above to a previous email). Addition overflow detection for example involves a single subtract, along with from one to three compares. The library is currently implemented over the following data types: uint8_t, uint16_t, uint32_t uint64_t, int8_t, int16_t, int32_t int64_t. Some of the template specializations for overflow detection were tricky for the 64-bit types, given the issues with negative, maximum range values. These specializations exist and are fully unit tested. Thank you, Ben Robinson
Best regards, Antony Polukhin
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost