[#mp_units-quantity-01-2constructor-08]
= xref:mp_units.adoc[mp&lowbar;units]::xref:mp_units/quantity-01.adoc[quantity]::quantity
:relfileprefix: ../../
:mrdocs:

Constructs a quantity from an external quantity&hyphen;like type via `quantity&lowbar;like&lowbar;traits`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;xref:mp_units/QuantityLike.adoc[QuantityLike] Q&gt;
requires detail&colon;&colon;QuantityConstructibleFrom&lt;quantity, detail&colon;&colon;quantity&lowbar;like&lowbar;type&lt;Q&gt;&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
explicit(quantity&lowbar;like&lowbar;traits&lt;Q&gt;&colon;&colon;explicit&lowbar;import &verbar;&verbar; !std&colon;&colon;convertible&lowbar;to&lt;detail&colon;&colon;quantity&lowbar;like&lowbar;type&lt;Q&gt;, quantity&lt;R, Rep&gt;&gt;)
quantity(Q const& q);
----

== Return Value

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

[cols="1,4"]
|===
| Name| Description
| *q*
| the source value, adapted through `quantity&lowbar;like&lowbar;traits&lt;Q&gt;`
|===


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