[#mp_units-utility-detail-checked_int_cast]
= xref:mp_units.adoc[mp&lowbar;units]::xref:mp_units/utility.adoc[utility]::xref:mp_units/utility/detail.adoc[detail]::checked&lowbar;int&lowbar;cast
:relfileprefix: ../../../
:mrdocs:

== 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; To,
    typename EP,
    typename From&gt;
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;To, const From&amp;&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
To
checked&lowbar;int&lowbar;cast(From const& v);
----

== Return Value

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

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