Crypto++ 8.6 Free C++ class library of cryptographic schemes

Static Public Member Functions | List of all members
SafeShifter< false > Struct Reference

Shifts a value in the absence of overflow. More...

## Static Public Member Functions
template<class T >
static T | RightShift (T value, unsigned int bits)
| Right shifts a value that does not overflow. More...
template<class T >
static T | LeftShift (T value, unsigned int bits)
| Left shifts a value that does not overflow. More...

## Detailed Description

Shifts a value in the absence of overflow.

the false template parameter indicates overflow would not occur. In this case, SafeShifter returns the shfted value.

Definition at line 2683 of file misc.h.

## Member Function Documentation

## ◆ RightShift()

template<class T >

static T SafeShifter< false >::RightShift | ( | T | value,
|  | unsigned int | bits
| ) |  |
| inline static

Right shifts a value that does not overflow.

Template Parameters

  T | class or type

Returns
  the shifted value

Since `overflow == false`, the shifted value is returned.

See also
  SafeLeftShift

Definition at line 2691 of file misc.h.

## ◆ LeftShift()

template<class T >

static T SafeShifter< false >::LeftShift | ( | T | value,
|  | unsigned int | bits
| ) |  |
| inline static

Left shifts a value that does not overflow.

Template Parameters

  T | class or type

Returns
  the shifted value

Since `overflow == false`, the shifted value is returned.

See also
  SafeRightShift

Definition at line 2702 of file misc.h.

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

- misc.h