[#mp_units-utility-safe_int-07-2constructor-06]
= xref:mp_units.adoc[mp&lowbar;units]::xref:mp_units/utility.adoc[utility]::xref:mp_units/utility/safe_int-07.adoc[safe&lowbar;int]::safe&lowbar;int
:relfileprefix: ../../../
:mrdocs:

Constructs a `safe&lowbar;int&lt;T, ErrorPolicy&gt;` from a `safe&lowbar;int` wrapping a different integral type, checking for overflow&period;

== Synopsis

Declared in `&lt;mp&hyphen;units&sol;utility&sol;safe&lowbar;int&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&sol;&ast; implementation-defined &ast;&sol; U&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
explicit(!detail&colon;&colon;is&lowbar;value&lowbar;preserving&lowbar;int&lowbar;v&lt;U, T&gt;)
safe&lowbar;int(xref:mp_units/utility/safe_int-07.adoc[safe&lowbar;int&lt;U, ErrorPolicy&gt;] other);
----

== Return Value

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| the `safe&lowbar;int` to convert from
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
