A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../error/error_code/../../numeric/saturate_cast.html below:

std::saturate_cast - cppreference.com

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

(since C++26)

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).

[edit] Parameters [edit] Return value [edit] Notes [edit] Possible implementation

See libstdc++ (GCC).

[edit] Example [edit] See also reinterpret the object representation of one type as that of another
(function template) [edit] clamps a value between a pair of boundary values
(function template) [edit] checks if an integer value is in the range of a given integer type
(function template) [edit]

RetroSearch 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