19 inline uint32_t count_1_bits(
const T&)
21 throw SpartaException(
"Unsupported type for count_1_bits: ") <<
typeid(T).name();
27 inline uint32_t count_1_bits<uint32_t>(
const uint32_t& n)
29 uint32_t x = n - (( n >> 1) & 0x55555555);
30 x = (x & 0x33333333) + (( x >> 2) & 0x33333333);
31 x = (x + (x >> 4)) & 0x0F0F0F0F;
38 inline uint32_t count_1_bits<uint64_t>(
const uint64_t& n)
40 uint64_t x = n - (( n >> 1) & 0x5555555555555555ull);
41 x = (x & 0x3333333333333333ull) + (( x >> 2) & 0x3333333333333333ull);
42 x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0Full;
Exception class for all of Sparta.
Macros for handling exponential backoff.