![]() |
Bitcoin Core 31.0.0
P2P Digital Currency
|
#include <climits>#include <concepts>#include <limits>#include <optional>#include <type_traits>Go to the source code of this file.
Functions | |
| template<class T> | |
| bool | AdditionOverflow (const T i, const T j) noexcept |
| template<class T> | |
| std::optional< T > | CheckedAdd (const T i, const T j) noexcept |
| template<std::unsigned_integral T, std::unsigned_integral U> | |
| constexpr bool | TrySub (T &i, const U j) noexcept |
| template<class T> | |
| T | SaturatingAdd (const T i, const T j) noexcept |
| template<std::integral T> | |
| constexpr std::optional< T > | CheckedLeftShift (T input, unsigned shift) noexcept |
| Left bit shift with overflow checking. | |
| template<std::integral T> | |
| constexpr T | SaturatingLeftShift (T input, unsigned shift) noexcept |
| Left bit shift with safe minimum and maximum values. | |
Definition at line 26 of file overflow.h.
|
constexprnoexcept |
Left bit shift with overflow checking.
| input | The input value to be left shifted. |
| shift | The number of bits to left shift. |
Definition at line 67 of file overflow.h.
Left bit shift with safe minimum and maximum values.
| input | The input value to be left shifted. |
| shift | The number of bits to left shift. |
Definition at line 86 of file overflow.h.
|
nodiscardconstexprnoexcept |