Age | Commit message (Collapse) | Author |
|
Once again, we need to hint the compiler that it should inline the function, and
then it is able to eliminate the assertion.
|
|
The two-argument version doesn't need an extra template parameter.
|
|
Apparently Clang does not have __builtin_foo_overflow_p()
Fixes #2044.
|
|
And switch the two-argument version of Checked::multiplication_would_overflow()
to use __builtin_mul_overflow_p(). This helps GCC optimize the code better.
|
|
This allows you to comfortably test if multiply 2 or 3 values would
cause arithmetic overflow.
|
|
A Checked<T> is a boxed integer type that asserts if you try to use its
value after an arithmetic overflow.
|