libtins
4.0
|
Represents a field of n bits. More...
#include <small_uint.h>
Public Types | |
typedef best_type< n >::type | repr_type |
Public Member Functions | |
small_uint () | |
small_uint (repr_type val) | |
Copy constructs the stored value. More... | |
operator repr_type () const | |
Static Public Attributes | |
static const repr_type | max_value = power<2, n>::value - 1 |
Represents a field of n bits.
This finds the best integral type of at least n bits and uses it to store the wrapped value.
typedef best_type<n>::type Tins::small_uint< n >::repr_type |
The type used to store the value.
|
inline |
Value initializes the value.
|
inline |
Copy constructs the stored value.
This throws a value_too_large exception if the value provided is larger than max_value.
val | The parameter from which to copy construct. |
|
inline |
User defined conversion to repr_type.
|
static |
The maximum value this class can hold.