I would suggest having a look at the built-in functions of the compilers that feature an overflow check. According to this post most recent compilers (GCC, Clang, Intel, MSVC) provide them. Documentation: https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html
bool __builtin_add_overflow (type1 a, type2 b, type3 *res)
bool __builtin_sub_overflow (type1 a, type2 b, type3 *res)
bool __builtin_mul_overflow (type1 a, type2 b, type3 *res)
bool __builtin_add_overflow_p (type1 a, type2 b, type3 c)
bool __builtin_sub_overflow_p (type1 a, type2 b, type3 c)
bool __builtin_mul_overflow_p (type1 a, type2 b, type3 c)