10constexpr auto mod_2n(
auto value,
auto divisor)
noexcept ->
decltype(
auto) {
11 return value & (divisor - 1U);
18 return ((value & (value - 1U)) == 0);
Definition component.hpp:17
constexpr auto mod_2n(auto value, auto divisor) noexcept -> decltype(auto)
Calculate the value % b=2^n.
Definition bits.hpp:10
constexpr auto is_power_of_2(auto value) -> bool
Check if value is a power of 2.
Definition bits.hpp:17