Crypto++  8.2
Free C++ class library of cryptographic schemes
SafeShifter< overflow > Struct Template Reference

Safely shift values when undefined behavior could occur. More...

Detailed Description

template<bool overflow>
struct SafeShifter< overflow >

Safely shift values when undefined behavior could occur.

Template Parameters
overflowboolean 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.

See also
SafeShifter<true>, SafeShifter<false>

Definition at line 2631 of file misc.h.


The documentation for this struct was generated from the following file: