pabigot
0.1.1
C++ support classes
|
Entry-point to identifying unsigned integral types supporting a specific number of bits. More...
#include </mnt/devel/pabigot-cxx/include/pabigot/crc.hpp>
Entry-point to identifying unsigned integral types supporting a specific number of bits.
The concept here is derived from the approach in boost::integer, simplified by excluding signed types and exact representations; restricted by relying on the types in <cstdint> instead of native types; and possibly improved by not assuming the least and fast types are the same:
width
is the number of bits in the value;fast_type
is the fast unsigned type for width bits. This is highly likely to have more than width
bits; keep this in mind when byte-swapping values.least_type
is the least unsigned type for width bits. When width
is not a power of 2 this is highly likely to have more than width
bits; keep this in mind when byte-swapping values.C | a category value: 1 for 64 bit, 2 for 32 bit, 3 for 16 bit, and 4 for 8 bit. A specialization is provided for each of these. |