countl_one_constexpr#

Fully qualified name: carb::cpp::countl_one_constexpr

Defined in carb/cpp/Bit.h

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

Returns the number of consecutive 1 bits in the value of val, starting from the most significant bit (“left”).

Note

Unlike countl_one(), this function is constexpr as it does not make use of intrinsics. Therefore, at runtime it is recommended to use countl_one() instead of this function.

Template Parameters:

T – An unsigned integral type

Parameters:

val – An unsigned integral value

Returns:

The number of consecutive 0 bits in the provided value, starting from the most significant bit.