ΒΆtemplate <typename T>
std::enable_if_t<std::is_unsigned<T>::value, T>
SaturatingAdd(T X,
T Y,
bool* ResultOverflowed = nullptr)
template <typename T>
std::enable_if_t<std::is_unsigned<T>::value, T>
SaturatingAdd(T X,
T Y,
bool* ResultOverflowed = nullptr)
Description
Add two unsigned integers, X and Y, of type T. Clamp the result to the maximum representable value of T on overflow. ResultOverflowed indicates if the result is larger than the maximum representable value of type T.
Declared at: llvm/include/llvm/Support/MathExtras.h:843
Templates
- T
Parameters
- T X
- T Y
- bool* ResultOverflowed = nullptr