Left bit shift with overflow checking.
Declared in <util/overflow.h>
template<std::integral T>
constexpr
std::optional<T>
CheckedLeftShift(
T input,
unsigned int shift) noexcept;
(input * 2^shift) or nullopt if it would not fit in the return type.
| Name | Description |
|---|---|
| input | The input value to be left shifted. |
| shift | The number of bits to left shift. |