25 #include <type_traits> 27 template<
class T,
class B,
28 class =
typename std::enable_if<std::is_integral<T>::value>
::type,
29 class = typename
std::enable_if<std::is_integral<B>::value>
::type>
31 {
return t | (0x1UL << b); }
33 template<
class T,
class B,
34 class =
typename std::enable_if<std::is_integral<T>::value>
::type,
35 class = typename
std::enable_if<std::is_integral<B>::value>
::type>
37 {
return t & ~(0x1UL << b); }
39 template<
class T,
class B,
40 class =
typename std::enable_if<std::is_integral<T>::value>
::type,
41 class = typename
std::enable_if<std::is_integral<B>::value>
::type>
43 {
return (t & (0x1UL << b)) >> b; }
45 template<
class T,
class B,
46 class =
typename std::enable_if<std::is_integral<T>::value>
::type,
47 class = typename
std::enable_if<std::is_integral<B>::value>
::type>
51 template<
class T,
class B,
52 class =
typename std::enable_if<std::is_integral<T>::value>
::type,
53 class = typename
std::enable_if<std::is_integral<B>::value>
::type>
58 class =
typename std::enable_if<std::is_integral<T>::value>
::type>
60 {
return __builtin_popcountll(t); }
62 template<
class T,
class M,
63 class =
typename std::enable_if<std::is_integral<T>::value>
::type,
64 class = typename
std::enable_if<std::is_integral<M>::value>
::type>
68 template<
class T,
class M,
class V,
69 class =
typename std::enable_if<std::is_integral<T>::value>
::type,
70 class = typename
std::enable_if<std::is_integral<M>::value>
::type,
71 class = typename std::enable_if<std::is_integral<V>::value>
::type>
73 {
return (t & ~m) | (v & m); }
auto num_bits_set(T t) noexcept
auto get_bit(T t, B b) noexcept
void uint64_t uint64_t uint64_t *rdx noexcept
auto is_bit_cleared(T t, B b) noexcept
auto clear_bit(T t, B b) noexcept
auto set_bit(T t, B b) noexcept
auto get_bits(T t, M m) noexcept
auto is_bit_set(T t, B b) noexcept
auto set_bits(T t, M m, V v) noexcept