Regina Calculation Engine
|
A generic class for bitwise analysis and manipulation of native data types. More...
#include <utilities/bitmanip.h>
Static Public Member Functions | |
static int | firstBit (T x) |
Returns the index of the first true bit in the given integer, or -1 if the given integer is zero. More... | |
static int | lastBit (T x) |
Returns the index of the last true bit in the given integer, or -1 if the given integer is zero. More... | |
A generic class for bitwise analysis and manipulation of native data types.
This class is not optimised for common data types; its sole functionality is to provide default implementations for some operations that are not yet optimised (or do not need to be).
End users should use BitManipulator<T, size> instead, which is better optimised and which has all the functionality of this class.
See BitManipulator for further information.
|
inlinestatic |
Returns the index of the first true
bit in the given integer, or -1 if the given integer is zero.
Bits are indexed from 0 upwards, starting at the least significant bit.
x | the integer of type T to examine. |
true
bit, or -1 if there are no true
bits.
|
inlinestatic |
Returns the index of the last true
bit in the given integer, or -1 if the given integer is zero.
Bits are indexed from 0 upwards, starting at the least significant bit.
x | the integer of type T to examine. |
true
bit, or -1 if there are no true
bits.