Returns the smallest integral power of two no smaller than Value if Value is nonzero. Returns 1 otherwise.
Declared in <llvm/ADT/bit.h>
template<typename T>
[[nodiscard]]
T
bit_ceil(T Value);
Ex. bit_ceil(5) == 8.
The return value is undefined if the input is larger than the largest power of two representable in T.
Smallest power of two ≥ Value, or 1 if Value is less than 2.
The return value should not be discarded.
| Name | Description |
|---|---|
| Value | Unsigned value to ceil to a power of two. |