C++ library for safe integer arithmetic with overflow detection.
Class library for C++ that manages integer overflows
$ g++ -I$(brew --prefix safeint)/include example.cpp -o example && ./example$ #include <SafeInt.hpp>
int main() { SafeInt<int> a = 100000; SafeInt<int> b = 100000; auto result = a * b; }$ #include <SafeInt.hpp>
SafeInt<unsigned int> value = user_input; // throws on overflow$ #include <SafeInt.hpp>
SafeInt<int> small = SafeInt<long long>(large_value);$ g++ -I$(brew --prefix safeint)/include -std=c++11 myprogram.cpp -o myprogram