pabigot
0.1.1
C++ support classes
|
Extend the size-related traits with functionality operating on the specific types. More...
#include </mnt/devel/pabigot-cxx/include/pabigot/crc.hpp>
Public Types | |
using | super = uint_size_traits< C > |
using | fast_limits = std::numeric_limits< fast_type > |
Static Public Member Functions | |
static constexpr fast_type | reverse (const fast_type &v, unsigned int bits) |
Reverse bits [0..bits) of v . More... | |
static constexpr fast_type | mask_for_bits (unsigned int bits) |
Helper to calculate the value of a B-bit mask as an instance of the unsigned type T. More... | |
Extend the size-related traits with functionality operating on the specific types.
Specifically, provide the ability to bit-reverse a value stored in the low bits of a word. This supports the requirements of a reflected (LSB-first) algorithm.
|
inlinestaticconstexpr |
Helper to calculate the value of a B-bit mask as an instance of the unsigned type T.
Need this evaluated at compile-time, supporting both cases where T can represent strictly more bits than are needed and where T represents exactly that many bits.
T | an unsigned integral type. |
bits | the number of bits to be masked. If bits is greater than the number of bits representable in T undefined behavior may result. |
|
inlinestaticconstexpr |
Reverse bits [0..bits)
of v
.