Crypto++ 8.7
Free C++ class library of cryptographic schemes
|
Safely shift values when undefined behavior could occur. More...
Safely shift values when undefined behavior could occur.
overflow | boolean flag indicating if overflow is present |
SafeShifter safely shifts values when undefined behavior could occur under C/C++ rules. The class behaves much like a saturating arithmetic class, clamping values rather than allowing the compiler to remove undefined behavior.