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

Constructor

== 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/Reference.adoc[Reference] R2&gt;
requires (equivalent(unit, get&lowbar;unit(R2&lcub;&rcub;)))
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
quantity(
    xref:mp_units/quantity-01/rep.adoc[rep] val,
    R2);
----

== Return Value

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

[cols="1,4"]
|===
| Name| Description
| *val*
| The object to construct from
|===


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