folly::constexpr_log2

Compute the integer base-2 logarithm of a value.

Synopsis

Declared in <folly/ConstexprMath.h>

template<typename T>
constexpr
T
constexpr_log2(T t);

Return Value

The floor of the base-2 logarithm of t.

Parameters

NameDescription
tThe value whose base-2 logarithm is computed.