Constructs a safe_int<T, ErrorPolicy> from a safe_int wrapping a different integral type, checking for overflow.

Synopsis

Declared in <mp‐units/utility/safe_int.h>

template</* implementation-defined */ U>
[[nodiscard]]
constexpr
explicit(!detail::is_value_preserving_int_v<U, T>)
safe_int(safe_int<U, ErrorPolicy> other);

Return Value

Note

The return value should not be discarded.

Parameters

Name

Description

other

the safe_int to convert from

Created with MrDocs