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

Returns this quantity re&hyphen;expressed with another representation type, applying an explicit rounding policy&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/RepresentationOf.adoc[RepresentationOf&lt;quantity&lowbar;spec&gt;] ToRep,
    xref:mp_units/RoundingPolicy.adoc[RoundingPolicy] Policy&gt;
requires std&colon;&colon;constructible&lowbar;from&lt;ToRep, rep&gt; &amp;&amp; detail&colon;&colon;ValidRoundingPolicyFor&lt;Policy, rep, ToRep&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
xref:mp_units/QuantityOf.adoc[QuantityOf&lt;quantity&lowbar;spec&gt;] auto
in(Policy policy) const;
----

== Return Value

The equivalent quantity with representation type `ToRep`&period;

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

[cols="1,4"]
|===
| Name| Description
| *policy*
| the rounding policy to apply when the conversion is not exact
|===


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