[#mp_units-quantity-01-2conversion-0a]
= xref:mp_units.adoc[mp&lowbar;units]::xref:mp_units/quantity-01.adoc[quantity]::operator 
:relfileprefix: ../../
:mrdocs:

Conversion operators

== Synopses

Declared in `&lt;mp&hyphen;units&sol;framework&sol;quantity&period;h&gt;`

Conversion to `Q&lowbar;`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Q&lowbar;,
    xref:mp_units/QuantityLike.adoc[QuantityLike] Q = std::remove&lowbar;cvref&lowbar;t&lt;Q&lowbar;&gt;&gt;
requires detail&colon;&colon;QuantityConstructibleFrom&lt;detail&colon;&colon;quantity&lowbar;like&lowbar;type&lt;Q&gt;, quantity&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
explicit(quantity&lowbar;like&lowbar;traits&lt;Q&gt;&colon;&colon;explicit&lowbar;export &verbar;&verbar; !std&colon;&colon;convertible&lowbar;to&lt;quantity&lt;R, Rep&gt;, detail&colon;&colon;quantity&lowbar;like&lowbar;type&lt;Q&gt;&gt;)
operator Q&lowbar;() const noexcept(noexcept(quantity&lowbar;like&lowbar;traits&lt;Q&gt;&colon;&colon;from&lowbar;numerical&lowbar;value(this&hyphen;&gt;numerical&lowbar;value&lowbar;is&lowbar;an&lowbar;implementation&lowbar;detail&lowbar;)) &amp;&amp; std&colon;&colon;is&lowbar;nothrow&lowbar;copy&lowbar;constructible&lowbar;v&lt;rep&gt;);
----

[.small]#xref:mp_units/quantity-01/2conversion-08.adoc[_» more&period;&period;&period;_]#

Conversion to `V&lowbar;`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename V&lowbar;,
    std::constructible&lowbar;from&lt;rep&gt; Value = std::remove&lowbar;cvref&lowbar;t&lt;V&lowbar;&gt;&gt;
requires detail&colon;&colon;ExplicitFromNumber&lt;reference&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
explicit
operator V&lowbar;() const &amp; noexcept;
----

[.small]#xref:mp_units/quantity-01/2conversion-05.adoc[_» more&period;&period;&period;_]#


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