Contains implementation details for BitManipulator where we optimise according to the size of the underlying data type.
More...
#include <utilities/bitmanip.h>
|
static int | bits (T x) |
| Returns the number of bits that are set to 1 in the given integer. More...
|
|
template<typename T, unsigned size = sizeof(T)>
class regina::BitManipulatorBySize< T, size >
Contains implementation details for BitManipulator where we optimise according to the size of the underlying data type.
End users should use the BitManipulator class, not this class.
- Precondition
- Type T is an unsigned integral numeric type.
-
The argument size is a power of two, and is at most sizeof(T).
- Template Parameters
-
T | an unsigned integral numeric type, which we treat as a sequence of true and/or false bits. |
size | the number of bytes of T to examine. Any higher-order bits will be ignored by the implementations in this class. |
◆ anonymous enum
template<typename T, unsigned size = sizeof(T)>
Enumerator |
---|
specialised | Indicates whether this class is a template specialisation of BitManipulatorBySize with extra optimisations.
This compile-time constant is set to 0 for the generic implementation of BitManipulatorBySize, and 1 for all specialisations.
|
◆ bits()
template<typename T, unsigned size = sizeof(T)>
Returns the number of bits that are set to 1 in the given integer.
- Parameters
-
x | the integer of type T to examine. |
- Returns
- the number of bits that are set.
The documentation for this class was generated from the following file: