Returns the number of bits needed to represent Value if Value is nonzero. Returns 0 otherwise.

Synopsis

Declared in <llvm/ADT/bit.h>

template<typename T>
[[nodiscard]]
constexpr
int
bit_width_constexpr(T Value);

Description

A constexpr version of bit_width.

Ex. bit_width_constexpr(5) == 3.

Return Value

Note

The return value should not be discarded.

Created with MrDocs