Mjolnir Core
Core functionality of the Mjolnir API

◆ get_bits() [1/2]

constexpr auto get_bits ( T_Type  integer) -> T_ReturnType
constexprnoexcept

Extract a bit pattern from an integer and store it with an optional shift in a new integer.

Template Parameters
t_num_bitsThe patterns number of bits
t_indexThe index of the first bit of the bit pattern
t_shiftAn integer that specifies the direction and magnitude that the bit pattern should be shifted. Positive values will shift it to the left (higher values) while negative values will shift the bit to the right (lower values).
T_TypeThe type of the source integer.
T_ReturnTypeThe type of the returned integer
Parameters
[in]integerThe source integer
Returns
An integer containing the extracted and shifted bit pattern.