43constexpr auto add_sat(T x, T y)
noexcept ->
44 typename std::enable_if_t<std::is_integral<T>::value, T>
48 bool overflow = __builtin_add_overflow(x, y, &result);
54 return std::numeric_limits<T>::min();
56 return std::numeric_limits<T>::max();
constexpr auto add_sat(T x, T y) noexcept -> typename std::enable_if_t< std::is_integral< T >::value, T >
Computes the saturating addition x + y for integral types.