Files
2025-10-25 03:02:53 +03:00

959 B

[numeric.sat.cast]

26 Algorithms library [algorithms]

26.10 Generalized numeric operations [numeric.ops]

26.10.17 Saturation arithmetic [numeric.sat]

26.10.17.2 Casting [numeric.sat.cast]

🔗

template<class R, class T> constexpr R saturate_cast(T x) noexcept;

1

#

Constraints: R and T are signed or unsigned integer types ([basic.fundamental]).

2

#

Returns: If x is representable as a value of type R, x; otherwise, either the largest or smallest representable value of type R, whichever is closer to the value of x.