C++ class library for safe integer arithmetic with overflow detection
Class library for C++ that manages integer overflows
safeint$ #include <SafeInt.hpp>
SafeInt<int> a = 2147483647;
SafeInt<int> b = a + 1; // Throws exception on overflow$ SafeInt<unsigned int> x = 100000;
SafeInt<unsigned int> y = 100000;
SafeInt<unsigned int> result = SafeMultiply(x, y);$ long long bigValue = 9223372036854775807LL;
int smallValue;
if (SafeCast(bigValue, smallValue)) { /* conversion safe */ }