Construct from U

Synopsis

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

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

Return Value

Note

The return value should not be discarded.

Parameters

Name

Description

v

The object to copy construct from

Created with MrDocs