Skip to content

mp_units::utility::safe_int::safe_int

Constructors

Synopses

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

Default constructor

[[nodiscard]] safe_int() = default;

» more...

Construct from safe_int

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

» more...

Construct from U

template<typename U>
  requires(!treat_as_floating_point<std::remove_cvref_t<U>>) && std::is_constructible_v<T, U>
[[nodiscard]] constexpr explicit(!detail::is_value_preserving_v<std::remove_cvref_t<U>, T> ||
                                 !std::convertible_to<U, T>) safe_int(U const& v);

» more...

Return Value

Note

The return value should not be discarded.