template< class T, class U >
constexpr T saturate_cast( U x ) noexcept;
Converts the value x to a value of type T
, clamping x between the minimum and maximum values of type T
.
The program is ill-formed if either T
or U
is not a signed or unsigned integer type (including standard integer type and extended integer type).
T
. Otherwise,T
, whichever is closer to the value of x.See libstdc++ (GCC).
[edit] Example [edit] See also reinterpret the object representation of one type as that of anotherRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4