SaturatingAdd overloads
Synopses
Declared in <llvm/Support/MathExtras.h>
Add two unsigned integers with saturation on overflow.
template<typename T>
T
SaturatingAdd(
T X,
T Y,
bool* ResultOverflowed = nullptr)
requires std::is_unsigned_v<T>;
Add multiple unsigned integers of type T with saturation on overflow.
template<
class T,
class... Ts>
T
SaturatingAdd(
T X,
T Y,
T Z,
Ts... Args)
requires std::is_unsigned_v<T>;
Return Value
-
The saturated sum of X and Y.
-
The saturated sum of all addends.
Parameters
Name |
Description |
X |
First addend. |
Y |
Second addend. |
ResultOverflowed |
Optional out‐parameter set when saturation occurs. |
Z |
Third addend. |
Args |
Additional unsigned addends. |
Created with MrDocs