chsvlib
chsv helper source code

◆ mirror_bits() [1/2]

constexpr auto Chusov::Memory::mirror_bits ( val)
constexprnoexcept

Inverts a bit order of an argument.

Template Parameters
TA type of the argument.
Parameters
valThe argument whose bit order is to be inversed.
Returns
The result of the inversion.

The function is defined only for basic sizes, i.e. 1, 2, 4 or 8 bytes, where a byte holds 8 bits. The function is constexpr if and only if the type T is a fundamental integral type. Unlike mirror_bits_kbo, mirror_bits also inverses the current byte order of val.