Functions
bitmanip.h File Reference

Go to the source code of this file.

Functions

template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto set_bit (T t, B b) noexcept
 
template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto clear_bit (T t, B b) noexcept
 
template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto get_bit (T t, B b) noexcept
 
template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto is_bit_set (T t, B b) noexcept
 
template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto is_bit_cleared (T t, B b) noexcept
 
template<class T , class = typename std::enable_if<std::is_integral<T>::value>::type>
auto num_bits_set (T t) noexcept
 
template<class T , class M , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<M>::value>::type>
auto get_bits (T t, M m) noexcept
 
template<class T , class M , class V , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<M>::value>::type, class = typename std::enable_if<std::is_integral<V>::value>::type>
auto set_bits (T t, M m, V v) noexcept
 

Function Documentation

◆ set_bit()

template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto set_bit ( t,
b 
)
noexcept

Definition at line 30 of file bitmanip.h.

◆ clear_bit()

template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto clear_bit ( t,
b 
)
noexcept

Definition at line 36 of file bitmanip.h.

◆ get_bit()

template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto get_bit ( t,
b 
)
noexcept

Definition at line 42 of file bitmanip.h.

◆ is_bit_set()

template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto is_bit_set ( t,
b 
)
noexcept

Definition at line 48 of file bitmanip.h.

◆ is_bit_cleared()

template<class T , class B , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<B>::value>::type>
auto is_bit_cleared ( t,
b 
)
noexcept

Definition at line 54 of file bitmanip.h.

◆ num_bits_set()

template<class T , class = typename std::enable_if<std::is_integral<T>::value>::type>
auto num_bits_set ( t)
noexcept

Definition at line 59 of file bitmanip.h.

◆ get_bits()

template<class T , class M , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<M>::value>::type>
auto get_bits ( t,
m 
)
noexcept

Definition at line 65 of file bitmanip.h.

◆ set_bits()

template<class T , class M , class V , class = typename std::enable_if<std::is_integral<T>::value>::type, class = typename std::enable_if<std::is_integral<M>::value>::type, class = typename std::enable_if<std::is_integral<V>::value>::type>
auto set_bits ( t,
m,
v 
)
noexcept

Definition at line 72 of file bitmanip.h.