9 template<concepts::Un
signedInteger T>
11 if constexpr (
sizeof(T) <=
sizeof(
unsigned int)) {
12 return __builtin_popcount(value);
13 }
else if constexpr (
sizeof(T) <=
sizeof(
unsigned long)) {
14 return __builtin_popcountl(value);
15 }
else if constexpr (
sizeof(T) <=
sizeof(
unsigned long long)) {
16 return __builtin_popcountll(value);
18 static_assert(
sizeof(T) == 16);
20 auto high =
u64(value >> 64);
21 return (*
this)(low) + (*
this)(high);
Definition bit_proxy_reference.h:5
Definition bit_proxy_reference.h:5
constexpr auto popcount
Definition popcount.h:27
__UINT64_TYPE__ u64
Definition integers.h:12
Definition zstring_parser.h:9
constexpr auto operator()(T value) const -> int
Definition popcount.h:10
Definition numeric_limits.h:7