llvm::countl_zero_constexpr

Count number of 0's from the most significant bit to the least stopping at the first 1.

Synopsis

Declared in <llvm/ADT/bit.h>

template<typename T>
[[nodiscard]]
constexpr
int
countl_zero_constexpr(T Val);

Description

A constexpr version of countl_zero.

Only unsigned integral types are allowed.

Returns std::numeric_limits<T>::digits on an input of 0.

Return Value

Leading zero count, or std::numeric_limits<T>::digits if Val is 0.

NOTE

The return value should not be discarded.

Parameters

NameDescription
ValUnsigned value to scan from the most significant bit.