23/// Create a bitmask of a contiguous block of zeros, then ones, starting at the compile-time constant, input number.
24/**
25 Because the operator>>() is poorly defined this only works for unsigned types. This is because there may be a sign bit or two's complement representation of the negative number. Then shifting might cause the sign bit to be shifted into the number itself, possibly causing an infinite loop.
26
27 Complexity: compile-time: O(n) where n is at most the number of bits used to represent the input type.
28 run-time: O(1)
29 Space: O(1)
30*/
31template<
32unsignedlonglong MSetBit ///< The all-ones bitmask will start from the non-zero msb.
57/// Compute the bit position of the set bit, starting at the compile-time constant, input number.
58/**
59 Because the operator>>() is poorly defined this only works for unsigned types. This is because there may be a sign bit or two's complement representation of the negative number. Then shifting might cause the sign bit to be shifted into the number itself, possibly causing an infinite loop.
60
61 Complexity: compile-time: O(n) where n is at most the number of bits used to represent the input type.
62 run-time: O(1)
63 Space: O(1)
64*/
65template<
66unsignedlonglong SetBit ///< The set bit in the field.