Defined in carb/cpp/Bit.h

template<class T, std::enable_if_t<detail::IsUnsignedIntegral<T>::value, bool> = false>
constexpr T carb::cpp::bit_ceil(T val) noexcept

Finds the smallest integral power of two not less than the given value.

Template Parameters

T – An unsigned integral type


val – An unsigned integral value


The smallest integral power of two that is not smaller than val. Undefined if the resulting value is not representable in T.