20 #include <type_traits> 29 static_assert(std::is_unsigned_v<T>);
30 T ret = 0, d = std::numeric_limits<T>::digits;
31 const auto high = [&] {
return x >= T(1) << d - 1; };
constexpr T bit_width(T x) noexcept
Simple emulation of std::bit_width from C++20.
Definition: bitutils.hh:28
Definition: control.hh:31