Regina 7.3 Calculation Engine
|
Contains implementation details for BitManipulator where we optimise according to the size of the underlying data type. More...
#include <utilities/bitmanip.h>
Static Public Member Functions | |
static constexpr int | bits (T x) |
Returns the number of bits that are set to 1 in the given integer. More... | |
Static Public Attributes | |
static constexpr bool | specialised = false |
Indicates whether this class is a template specialisation of BitManipulatorBySize with extra optimisations. More... | |
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.
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. |
|
inlinestaticconstexpr |
Returns the number of bits that are set to 1 in the given integer.
Note that this routine will become redundant once we move to C++20, since we will be able to use std::popcount() instead.
x | the integer of type T to examine. |
|
staticconstexpr |
Indicates whether this class is a template specialisation of BitManipulatorBySize with extra optimisations.
This compile-time constant is set to false
for the generic implementation of BitManipulatorBySize, and true
for all specialisations.