<!DOCTYPE html><htmllang='en'><head><title>[qty.ref]</title><metacharset='UTF-8'/><linkrel='stylesheet'type='text/css'href='14882.css'/><linkrel='stylesheet'type='text/css'href='https://fonts.googleapis.com/css2?family=Noto+Serif'/><linkrel='stylesheet'type='text/css'href='https://fonts.googleapis.com/css2?family=Noto+Sans'/><linkrel='stylesheet'type='text/css'href='https://fonts.googleapis.com/css2?family=Noto+Sans+Mono'/><linkrel='icon'href='icon.png'/><linkrel='stylesheet'type='text/css'href='expanded.css'title='Normal'/><linkrel='alternate stylesheet'type='text/css'href='colored.css'title='Notes and examples colored'/><linkrel='alternate stylesheet'type='text/css'href='normative-only.css'title='Notes and examples hidden'/></head><body><divclass='wrapper'><h1><aclass='secnum'style='min-width:50pt'>5</a> Quantities and units library <aclass='abbr_ref'href='index.html#quantities'>[quantities]</a></h1><h2><aclass='secnum'style='min-width:65pt'>5.4</a> Reference <aclass='abbr_ref'>[qty.ref]</a></h2><divid='general'class='section'><h3><aclass='secnum'href='#general'style='min-width:80pt'>5.4.1</a> General <aclass='abbr_ref'href='qty.ref.general.html'>[qty.ref.general]</a></h3><divclass='para'id='general-1'><divclass='marginalizedparent'><aclass='marginalized'href='#general-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1336'>#</a></div><divclass='texpara'><divid='general-1.sentence-1'class='sentence'>Subclause [qty.<spanclass='shy'></span>ref] specifies the components
for describing the reference of a quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-01">IEC 60050, 112-01-01</a>)<aclass='hidden_link'href='#general-1.sentence-1'>.</a></div></div></div></div><divid='qty.dim'class='section'><h3><aclass='secnum'href='#qty.dim'style='min-width:80pt'>5.4.2</a> Dimension <aclass='abbr_ref'href='qty.dim.html'>[qty.dim]</a></h3><divid='qty.dim.general'class='section'><h4><aclass='secnum'href='#qty.dim.general'style='min-width:95pt'>5.4.2.1</a> General <aclass='abbr_ref'href='qty.dim.general.html'>[qty.dim.general]</a></h4><divclass='para'id='qty.dim.general-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.dim.general-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1344'>#</a></div><divclass='texpara'><divid='qty.dim.general-1.sentence-1'class='sentence'>Subclause <ahref='#qty.dim'title='5.4.2 Dimension'>[qty.<spanclass='shy'></span>dim]</a> specifies the components
for defining the dimension of a quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-11">IEC 60050, 112-01-11</a>)<aclass='hidden_link'href='#qty.dim.general-1.sentence-1'>.</a></div></div></div></div><divid='qty.dim.concepts'class='section'><h4><aclass='secnum'href='#qty.dim.concepts'style='min-width:95pt'>5.4.2.2</a> Concepts <aclass='abbr_ref'href='qty.dim.concepts.html'>[qty.dim.concepts]</a></h4><divclass='texpara'><divclass='itemdecl'id='qty.dim.concepts-itemdecl:1'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#qty.dim.concepts-itemdecl:1'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> T<spanclass='anglebracket'>></span>
</span></div><divclass='para'id='qty.dim.types-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.dim.types-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1375'>#</a></div><divclass='texpara'><divid='qty.dim.types-1.sentence-1'class='sentence'><spanclass='texttt'>base_<spanclass='shy'></span>dimension</span> is used
to define the dimension of a base quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-08">IEC 60050, 112-01-08</a>)<aclass='hidden_link'href='#qty.dim.types-1.sentence-1'>.</a></div><divid='qty.dim.types-1.sentence-2'class='sentence'><spanclass='texttt'>Symbol</span> is its symbolic representation<aclass='hidden_link'href='#qty.dim.types-1.sentence-2'>.</a></div><divid='qty.dim.types-example-1'class='example'><divclass='texpara'>[<i>Example <ahref='#qty.dim.types-example-1'>1</a></i>: <spanclass='codeblock'><spanclass='keyword'>inline</span><spanclass='keyword'>constexpr</span><spanclass='keyword'>struct</span> dim_length <spanclass='keyword'>final</span><spanclass='operator'>:</span> base_dimension<spanclass='anglebracket'><</span><spanclass='literal'>"L"</span><spanclass='anglebracket'>></span><spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span> dim_length;
</span></span></div></div><divclass='para'id='qty.dim.types-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.dim.types-2'>2</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1399'>#</a></div><divclass='texpara'><divid='qty.dim.types-2.sentence-1'class='sentence'><spanclass='texttt'>derived_<spanclass='shy'></span>dimension</span> is used by the library
to represent the dimension of a derived quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-10">IEC 60050, 112-01-10</a>)<aclass='hidden_link'href='#qty.dim.types-2.sentence-1'>.</a></div><divid='qty.dim.types-example-2'class='example'><divclass='texpara'>[<i>Example <ahref='#qty.dim.types-example-2'>2</a></i>: <spanclass='codeblock'><spanclass='keyword'>constexpr</span><spanclass='keyword'>auto</span> dim_acceleration <spanclass='operator'>=</span> isq<spanclass='operator'>::</span>speed<spanclass='operator'>.</span>dimension <spanclass='operator'>/</span> isq<spanclass='operator'>::</span>dim_time;
<spanclass='keyword'>int</span> x <spanclass='operator'>=</span> dim_acceleration; <spanclass='comment'>// error: cannot construct from</span>
A program that instantiates a specialization of <spanclass='texttt'>derived_<spanclass='shy'></span>dimension</span>
that is not a possible result of the library specifications
is ill-formed, no diagnostic required<aclass='hidden_link'href='#qty.dim.types-2.sentence-2'>.</a></div></div><divclass='texpara'><spanid='lib:dimension_one'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:dimension_one'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
</span></span></div></div><divclass='para'id='qty.dim.types-3'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.dim.types-3'>3</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1422'>#</a></div><divclass='texpara'><divid='qty.dim.types-3.sentence-1'class='sentence'><spanclass='texttt'>dimension_<spanclass='shy'></span>one</span> represents the dimension of a quantity of dimension one (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-13">IEC 60050, 112-01-13</a>)<aclass='hidden_link'href='#qty.dim.types-3.sentence-1'>.</a></div></div></div></div><divid='qty.dim.ops'class='section'><h4><aclass='secnum'href='#qty.dim.ops'style='min-width:95pt'>5.4.2.4</a> Operations <aclass='abbr_ref'href='qty.dim.ops.html'>[qty.dim.ops]</a></h4><divclass='texpara'><spanid='lib:dimension-interface'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:dimension-interface'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
<spanclass='keyword'>constexpr</span> Out dimension_symbol_to<spanclass='parenthesis'>(</span>Out out, D d, <spanclass='keyword'>const</span> dimension_symbol_formatting<spanclass='operator'>&</span> fmt <spanclass='operator'>=</span><spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span><spanclass='parenthesis'>)</span>;
</code></div></div></div></div><divclass='para'id='qty.dim.sym.fmt-3'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.dim.sym.fmt-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1552'>#</a></div><divclass='texpara'><divid='qty.dim.sym.fmt-3.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
for defining a quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-01">IEC 60050, 112-01-01</a>)<aclass='hidden_link'href='#qty.spec.general-1.sentence-1'>.</a></div></div></div></div><divid='qty.spec.concepts'class='section'><h4><aclass='secnum'href='#qty.spec.concepts'style='min-width:95pt'>5.4.3.2</a> Concepts <aclass='abbr_ref'href='qty.spec.concepts.html'>[qty.spec.concepts]</a></h4><divclass='texpara'><divclass='itemdecl'id='qty.spec.concepts-itemdecl:1'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#qty.spec.concepts-itemdecl:1'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> T<spanclass='anglebracket'>></span>
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>auto</span> To, <spanclass='keyword'>auto</span> From<spanclass='anglebracket'>></span>
<spanclass='keyword'>static</span><spanclass='keyword'>constexpr</span> quantity_character character <spanclass='operator'>=</span><i><spanclass='texttt'>see below</span></i>;
<spanclass='keyword'>static</span><spanclass='keyword'>constexpr</span> quantity_character character <spanclass='operator'>=</span><i><spanclass='texttt'>see below</span></i>;
<spanclass='comment'>// if the <spanclass='textsf'><i>qualified-id</i></span><spanclass='tcode_in_codeblock'><spanclass='tcode_in_codeblock'><i>parent</i></span>.<spanclass='tcode_in_codeblock'><i>equation</i></span></span> is valid and denotes an object</span>
<spanclass='keyword'>static</span><spanclass='keyword'>constexpr</span> quantity_character character <spanclass='operator'>=</span><i><spanclass='texttt'>see below</span></i>;
<spanclass='keyword'>static</span><spanclass='keyword'>constexpr</span> quantity_character character <spanclass='operator'>=</span><i><spanclass='texttt'>see below</span></i>;
</span></span></span></div><divclass='para'id='named.qty-1'><divclass='marginalizedparent'><aclass='marginalized'href='#named.qty-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1669'>#</a></div><divclass='texpara'><divid='named.qty-1.sentence-1'class='sentence'>A <aclass='hidden_link'href='#def:quantity,named'title='5.4.3.3.1 Named [named.qty]'><spanid='def:quantity,named'><i>named quantity</i></span></a> is a type that models <aclass='index'id='conceptref:NamedQuantitySpec__'></a><spanclass='texttt'><i>NamedQuantitySpec</i></span><aclass='hidden_link'href='#named.qty-1.sentence-1'>.</a></div><divid='named.qty-1.sentence-2'class='sentence'>A specialization of <spanclass='texttt'>quantity_<spanclass='shy'></span>spec</span> is used as a base type when defining a named quantity<aclass='hidden_link'href='#named.qty-1.sentence-2'>.</a></div></div></div><divclass='para'id='named.qty-2'><divclass='marginalizedparent'><aclass='marginalized'href='#named.qty-2'>2</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1673'>#</a></div><divclass='texpara'><divid='named.qty-2.sentence-1'class='sentence'>In the following descriptions, let <spanclass='texttt'>Q</span> be a named quantity defined with an alluded signature<aclass='hidden_link'href='#named.qty-2.sentence-1'>.</a></div><divid='named.qty-2.sentence-2'class='sentence'>The identifier of <spanclass='texttt'>Q</span> represents its quantity name (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-02">IEC 60050, 112-01-02</a>)<aclass='hidden_link'href='#named.qty-2.sentence-2'>.</a></div></div></div><divclass='para'id='named.qty-3'><divclass='marginalizedparent'><aclass='marginalized'href='#named.qty-3'>3</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1677'>#</a></div><divclass='texpara'><divid='named.qty-3.sentence-1'class='sentence'>Let <spanclass='texttt'>Ch</span> be an enumerator value of <spanclass='texttt'>quantity_<spanclass='shy'></span>character</span><aclass='hidden_link'href='#named.qty-3.sentence-1'>.</a></div><divid='named.qty-3.sentence-2'class='sentence'>The possible arguments to <spanclass='texttt'>quantity_<spanclass='shy'></span>spec</span> are
then<spanclass='texttt'>Q</span> is that base quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-08">IEC 60050, 112-01-08</a>)<aclass='hidden_link'href='#named.qty-4.sentence-1'>.</a></div><divid='named.qty-4.sentence-2'class='sentence'>If an argument is a quantity calculus (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-30">IEC 60050, 112-01-30</a>) <i>C</i>,
then <spanclass='texttt'>Q</span> is implicitly convertible from <i>C</i><aclass='hidden_link'href='#named.qty-4.sentence-2'>.</a></div><divid='named.qty-4.sentence-3'class='sentence'>If the first argument is a named quantity,
then <spanclass='texttt'>Q</span> is of its kind (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-04">IEC 60050, 112-01-04</a>)<aclass='hidden_link'href='#named.qty-4.sentence-3'>.</a></div></div></div><divclass='para'id='named.qty-5'><divclass='marginalizedparent'><aclass='marginalized'href='#named.qty-5'>5</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1699'>#</a></div><divclass='texpara'><divid='named.qty-5.sentence-1'class='sentence'>The member <spanclass='texttt'>character</span> represents
the set of the numerical value of <spanclass='texttt'>Q</span> (<ahref='qty.char.traits.html'title='5.5.2.2 Quantity character'>[qty.<spanclass='shy'></span>char.<spanclass='shy'></span>traits]</a>)
<ulclass='itemize'><liid='named.qty-5.1'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#named.qty-5.1'>(5.1)</a></div><spanclass='texttt'>Ch</span> if specified,</li><liid='named.qty-5.2'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#named.qty-5.2'>(5.2)</a></div>otherwise, <spanclass='texttt'>quantity_<spanclass='shy'></span>character<spanclass='operator'>​::​</span>real_<spanclass='shy'></span>scalar</span> for the first signature, and</li><liid='named.qty-5.3'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#named.qty-5.3'>(5.3)</a></div>otherwise, <spanclass='texttt'><spanclass='parenthesis'>(</span>BC<spanclass='parenthesis'>)</span><spanclass='operator'>.</span>character</span>,
where <spanclass='texttt'>BC</span> is the argument preceding <spanclass='texttt'>Ch</span> in the signatures above<aclass='hidden_link'href='#named.qty-5.sentence-1'>.</a></li></ul></div></div></div><divclass='para'id='named.qty-6'><divclass='marginalizedparent'><aclass='marginalized'href='#named.qty-6'>6</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1713'>#</a></div><divclass='texpara'><divid='named.qty-6.sentence-1'class='sentence'><spanclass='texttt'>is_<spanclass='shy'></span>kind</span> specifies <spanclass='texttt'>Q</span> to start a new hierarchy tree of a kind<aclass='hidden_link'href='#named.qty-6.sentence-1'>.</a></div></div></div><divclass='para'id='named.qty-7'><divclass='marginalizedparent'><aclass='marginalized'href='#named.qty-7'>7</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1716'>#</a></div><divclass='texpara'><divid='named.qty-7.sentence-1'class='sentence'>Optional arguments may appear in any order<aclass='hidden_link'href='#named.qty-7.sentence-1'>.</a></div></div></div><divclass='para nonNormativeOnly'id='named.qty-8'><divclass='marginalizedparent'><aclass='marginalized'href='#named.qty-8'>8</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1719'>#</a></div><divclass='texpara'><divid='named.qty-example-1'class='example'><divclass='texpara'>[<i>Example <ahref='#named.qty-example-1'>1</a></i>: <spanclass='codeblock'><spanclass='comment'>// The first signature defines a base quantity.</span>
<spanclass='curlybracket'>}</span> length; <spanclass='comment'>// Length is a base quantity.</span>
<spanclass='comment'>// The second signature defines a derived quantity.</span>
<spanclass='keyword'>inline</span><spanclass='keyword'>constexpr</span><spanclass='keyword'>struct</span> area <spanclass='keyword'>final</span><spanclass='operator'>:</span> quantity_spec<spanclass='anglebracket'><</span>pow<spanclass='anglebracket'><</span><spanclass='literal'>2</span><spanclass='anglebracket'>></span><spanclass='parenthesis'>(</span>length<spanclass='parenthesis'>)</span><spanclass='anglebracket'>></span><spanclass='curlybracket'>{</span>
<spanclass='curlybracket'>}</span> area; <spanclass='comment'>// An area equals length by length.</span>
<spanclass='comment'>// The third and fourth signatures add a leaf to a hierarchy of kinds.</span>
<spanclass='curlybracket'>}</span> angular_measure; <spanclass='comment'>// Requires an arc length per radius, not just any quantity of dimension one.</span>
<spanclass='keyword'>static</span><spanclass='keyword'>constexpr</span> quantity_character character <spanclass='operator'>=</span><i><spanclass='texttt'>see below</span></i>;
</span></span></div><divclass='para'id='derived.qty-1'><divclass='marginalizedparent'><aclass='marginalized'href='#derived.qty-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1768'>#</a></div><divclass='texpara'><divid='derived.qty-1.sentence-1'class='sentence'><spanclass='texttt'>derived_<spanclass='shy'></span>quantity_<spanclass='shy'></span>spec</span> is used by the library
to represent the result of a quantity calculus not equal to a named quantity<aclass='hidden_link'href='#derived.qty-1.sentence-1'>.</a></div><divid='derived.qty-example-1'class='example'><divclass='texpara'>[<i>Example <ahref='#derived.qty-example-1'>1</a></i>: <spanclass='codeblock'><spanclass='keyword'>constexpr</span><spanclass='keyword'>auto</span> area <spanclass='operator'>=</span> pow<spanclass='anglebracket'><</span><spanclass='literal'>2</span><spanclass='anglebracket'>></span><spanclass='parenthesis'>(</span>isq<spanclass='operator'>::</span>length<spanclass='parenthesis'>)</span>;
<spanclass='keyword'>int</span> x <spanclass='operator'>=</span> area; <spanclass='comment'>// error: cannot construct from <spanclass='tcode_in_codeblock'>derived_<spanclass='shy'></span>quantity_<spanclass='shy'></span>spec<power<isq​::​length, 2>></span></span>
is ill-formed, no diagnostic required<aclass='hidden_link'href='#derived.qty-1.sentence-2'>.</a></div></div></div><divclass='para'id='derived.qty-2'><divclass='marginalizedparent'><aclass='marginalized'href='#derived.qty-2'>2</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1781'>#</a></div><divclass='texpara'><divid='derived.qty-2.sentence-1'class='sentence'>Let
<ulclass='itemize'><liid='derived.qty-2.1'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#derived.qty-2.1'>(2.1)</a></div><spanclass='texttt'>Nums</span> and <spanclass='texttt'>Dens</span>
be packs denoting the template arguments of
<spanclass='texttt'><spanclass='texttt'><i>base</i></span><spanclass='operator'>​::​</span><spanclass='texttt'><i>nums</i></span></span> and <spanclass='texttt'><spanclass='texttt'><i>base</i></span><spanclass='operator'>​::​</span><spanclass='texttt'><i>dens</i></span></span>, respectively,</li><liid='derived.qty-2.2'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#derived.qty-2.2'>(2.2)</a></div><spanclass='texttt'><i>QUANTITY-CHARACTER-OF</i><spanclass='parenthesis'>(</span>Pack<spanclass='parenthesis'>)</span></span> be
and</li><liid='derived.qty-2.3'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#derived.qty-2.3'>(2.3)</a></div><spanclass='texttt'>num_<spanclass='shy'></span>char</span> be <spanclass='texttt'><i>QUANTITY-CHARACTER-OF</i><spanclass='parenthesis'>(</span>Nums<spanclass='parenthesis'>)</span></span> and
<spanclass='texttt'>den_<spanclass='shy'></span>char</span> be <spanclass='texttt'><i>QUANTITY-CHARACTER-OF</i><spanclass='parenthesis'>(</span>Dens<spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#derived.qty-2.sentence-1'>.</a></li></ul></div><divid='derived.qty-2.sentence-2'class='sentence'>
The member <spanclass='texttt'>character</span> is equal to
<spanclass='texttt'>quantity_<spanclass='shy'></span>character<spanclass='operator'>​::​</span>real_<spanclass='shy'></span>scalar</span> if <spanclass='texttt'>num_<spanclass='shy'></span>char <spanclass='operator'>=</span><spanclass='operator'>=</span> den_<spanclass='shy'></span>char</span> is <spanclass='texttt'><spanclass='literal'>true</span></span>, and
<spanclass='texttt'>std<spanclass='operator'>​::​</span>max<spanclass='parenthesis'>(</span>num_<spanclass='shy'></span>char, den_<spanclass='shy'></span>char<spanclass='parenthesis'>)</span></span> otherwise<aclass='hidden_link'href='#derived.qty-2.sentence-2'>.</a></div></div></div></div><divid='dimless.qty'class='section'><h4><aclass='secnum'href='#dimless.qty'style='min-width:110pt'>5.4.3.3.3</a> Base quantity of dimension one <aclass='abbr_ref'href='dimless.qty.html'>[dimless.qty]</a></h4><divclass='texpara'><spanid='lib:dimensionless'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:dimensionless'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
</span></span></div><divclass='para'id='dimless.qty-1'><divclass='marginalizedparent'><aclass='marginalized'href='#dimless.qty-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1813'>#</a></div><divclass='texpara'><divid='dimless.qty-1.sentence-1'class='sentence'><spanclass='texttt'>dimensionless</span> represents the base quantity of dimension one (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-13">IEC 60050, 112-01-13</a>)<aclass='hidden_link'href='#dimless.qty-1.sentence-1'>.</a></div></div></div></div><divid='kind.of.qty'class='section'><h4><aclass='secnum'href='#kind.of.qty'style='min-width:110pt'>5.4.3.3.4</a> Kind of <aclass='abbr_ref'href='kind.of.qty.html'>[kind.of.qty]</a></h4><divclass='texpara'><spanid='lib:kind_of_'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:kind_of_'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
</code></div></div></div></div><divclass='para'id='qty.spec.utils-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.spec.utils-1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1844'>#</a></div><divclass='texpara'><divid='qty.spec.utils-1.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
</code></div></div></div></div><divclass='para'id='qty.spec.utils-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.spec.utils-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1862'>#</a></div><divclass='texpara'><divid='qty.spec.utils-2.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
</code></div></div></div></div></div></div><divclass='para'id='qty.spec.utils-3'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.spec.utils-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L1882'>#</a></div><divclass='texpara'><divid='qty.spec.utils-3.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
<spanclass='keyword'>consteval</span><ahref='#concept:Reference'title='5.4.5 Concepts [qty.ref.concepts]'><spanid='conceptref:Reference_'><spanclass='tcode_in_codeblock'>Reference</span></span></a><spanclass='keyword'>auto</span><spanclass='keyword'>operator</span><spanclass='squarebracket'>[</span><spanclass='squarebracket'>]</span><spanclass='parenthesis'>(</span><spanclass='keyword'>this</span> Self self, U u<spanclass='parenthesis'>)</span>;
<spanclass='keyword'>consteval</span><ahref='#concept:Reference'title='5.4.5 Concepts [qty.ref.concepts]'><spanid='conceptref:Reference__'><spanclass='texttt'>Reference</span></span></a><spanclass='keyword'>auto</span><spanclass='keyword'>operator</span><spanclass='squarebracket'>[</span><spanclass='squarebracket'>]</span><spanclass='parenthesis'>(</span><spanclass='keyword'>this</span> Self self, U u<spanclass='parenthesis'>)</span>;
<i>expr-pow</i><spanclass='anglebracket'><</span>Num, Den, derived_quantity_spec, <spanclass='keyword'>struct</span> dimensionless<spanclass='anglebracket'>></span><spanclass='parenthesis'>(</span><i>remove-kind</i><spanclass='parenthesis'>(</span>q<spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span>;
</code></div></div></div></div><divclass='para'id='qty.get.kind-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.get.kind-1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2095'>#</a></div><divclass='texpara'><divid='qty.get.kind-1.sentence-1'class='sentence'><i>Returns</i>: <ulclass='itemize'><liid='qty.get.kind-1.1'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.get.kind-1.1'>(1.1)</a></div><divclass='texpara'><divid='qty.get.kind-1.1.sentence-1'class='sentence'>If <spanclass='texttt'><aclass='index'id='conceptref:QuantityKindSpec______'></a><spanclass='texttt'><i>QuantityKindSpec</i></span><spanclass='anglebracket'><</span>Q<spanclass='anglebracket'>></span></span> is <spanclass='texttt'><spanclass='literal'>true</span></span>,
returns <spanclass='texttt'><spanclass='texttt'><i>remove-kind</i></span><spanclass='parenthesis'>(</span>q<spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#qty.get.kind-1.1.sentence-1'>.</a></div></div></li><liid='qty.get.kind-1.2'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.get.kind-1.2'>(1.2)</a></div><divclass='texpara'><divid='qty.get.kind-1.2.sentence-1'class='sentence'>Otherwise, if
is <spanclass='texttt'><spanclass='literal'>true</span></span>, and
the specialization of <spanclass='texttt'>Q<spanclass='operator'>​::​</span>quantity_<spanclass='shy'></span>spec</span> has a template argument equal to <spanclass='texttt'>is_<spanclass='shy'></span>kind</span>,
returns <spanclass='texttt'>q</span><aclass='hidden_link'href='#qty.get.kind-1.2.sentence-1'>.</a></div></div></li><liid='qty.get.kind-1.3'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.get.kind-1.3'>(1.3)</a></div><divclass='texpara'><divid='qty.get.kind-1.3.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'>Q<spanclass='operator'>​::​</span><spanclass='texttt'><i>parent</i></span></span> is a valid expression,
returns <spanclass='texttt'><spanclass='texttt'><i>get-kind-tree-root</i></span><spanclass='parenthesis'>(</span>Q<spanclass='operator'>​::​</span><spanclass='texttt'><i>parent</i></span><spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#qty.get.kind-1.3.sentence-1'>.</a></div></div></li><liid='qty.get.kind-1.4'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.get.kind-1.4'>(1.4)</a></div><divclass='texpara'><divid='qty.get.kind-1.4.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'><aclass='index'id='conceptref:DerivedQuantitySpec__'></a><spanclass='texttt'><i>DerivedQuantitySpec</i></span><spanclass='anglebracket'><</span>Q<spanclass='anglebracket'>></span></span> is <spanclass='texttt'><spanclass='literal'>true</span></span>,
</code></div></div></div></div><divclass='para'id='qty.get.kind-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.get.kind-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2133'>#</a></div><divclass='texpara'><divid='qty.get.kind-2.sentence-1'class='sentence'><i>Returns</i>: <spanclass='texttt'>kind_<spanclass='shy'></span>of<spanclass='anglebracket'><</span><spanclass='texttt'><i>get-kind-tree-root</i></span><spanclass='parenthesis'>(</span>Q<spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span><spanclass='parenthesis'>)</span><spanclass='anglebracket'>></span></span><aclass='hidden_link'href='#qty.get.kind-2.sentence-1'>.</a></div></div></div></div></div><divid='get.common.qty.spec'class='section'><h4><aclass='secnum'href='#get.common.qty.spec'style='min-width:110pt'>5.4.3.6.3</a> Get common quantity specification <aclass='abbr_ref'href='get.common.qty.spec.html'>[get.common.qty.spec]</a></h4><divclass='texpara'><divid='lib:QuantitySpec,get_common_quantity_spec'><divid='lib:get_common_quantity_spec,QuantitySpec'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:get_common_quantity_spec,QuantitySpec'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>consteval</span><ahref='#concept:QuantitySpec'title='5.4.3.2 Concepts [qty.spec.concepts]'><spanid='conceptref:QuantitySpec________________________________________________'><spanclass='texttt'>QuantitySpec</span></span></a><spanclass='keyword'>auto</span> get_common_quantity_spec<spanclass='parenthesis'>(</span><ahref='#concept:QuantitySpec'title='5.4.3.2 Concepts [qty.spec.concepts]'><spanid='conceptref:QuantitySpec_________________________________________________'><spanclass='texttt'>QuantitySpec</span></span></a><spanclass='keyword'>auto</span><spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='operator'>.</span> qs<spanclass='parenthesis'>)</span>
<ulclass='itemize'><liid='get.common.qty.spec-1.1'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#get.common.qty.spec-1.1'>(1.1)</a></div><spanclass='texttt'>q1</span> be <spanclass='texttt'>qs<spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='squarebracket'>[</span><spanclass='literal'>0</span><spanclass='squarebracket'>]</span></span>,</li><liid='get.common.qty.spec-1.2'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#get.common.qty.spec-1.2'>(1.2)</a></div><spanclass='texttt'>q2</span> be <spanclass='texttt'>qs<spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='squarebracket'>[</span><spanclass='literal'>1</span><spanclass='squarebracket'>]</span></span>,</li><liid='get.common.qty.spec-1.3'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#get.common.qty.spec-1.3'>(1.3)</a></div><spanclass='texttt'>Q1</span> be <spanclass='texttt'><spanclass='keyword'>decltype</span><spanclass='parenthesis'>(</span>q1<spanclass='parenthesis'>)</span></span>,</li><liid='get.common.qty.spec-1.4'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#get.common.qty.spec-1.4'>(1.4)</a></div><spanclass='texttt'>Q2</span> be <spanclass='texttt'><spanclass='keyword'>decltype</span><spanclass='parenthesis'>(</span>q2<spanclass='parenthesis'>)</span></span>, and</li><liid='get.common.qty.spec-1.5'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#get.common.qty.spec-1.5'>(1.5)</a></div><spanclass='texttt'>rest</span> be a pack denoting the elements of <spanclass='texttt'>qs</span> without <spanclass='texttt'>q1</span> and <spanclass='texttt'>q2</span><aclass='hidden_link'href='#get.common.qty.spec-1.sentence-1'>.</a></li></ul></div></div></div></div><divclass='para'id='get.common.qty.spec-2'><divclass='marginalizedparent'><aclass='marginalized'href='#get.common.qty.spec-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2162'>#</a></div><divclass='texpara'><divid='get.common.qty.spec-2.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
</span></div></div></div></div><divclass='para'id='get.common.qty.spec-3'><divclass='marginalizedparent'><aclass='marginalized'href='#get.common.qty.spec-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2201'>#</a></div><divclass='texpara'><divid='get.common.qty.spec-3.sentence-1'class='sentence'><i>Remarks</i>: The expression in the <spanclass='textsf'><i>requires-clause</i></span> is equivalent to:
</span></div></div></div></div></div><divid='qty.get.common.base'class='section'><h4><aclass='secnum'href='#qty.get.common.base'style='min-width:110pt'>5.4.3.6.4</a> Get common base <aclass='abbr_ref'href='qty.get.common.base.html'>[qty.get.common.base]</a></h4><divclass='para'id='qty.get.common.base-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.get.common.base-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2216'>#</a></div><divclass='texpara'><divid='qty.get.common.base-1.sentence-1'class='sentence'>In this subclause and <ahref='#qty.is.child.of'title='5.4.3.6.5 Is child of'>[qty.<spanclass='shy'></span>is.<spanclass='shy'></span>child.<spanclass='shy'></span>of]</a>,
let the kind of quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-04">IEC 60050, 112-01-04</a>) hierarchy of <spanclass='texttt'>q</span> be the tuple
where <spanclass='texttt'>par</span> is <spanclass='texttt'><i>parent</i></span><aclass='hidden_link'href='#qty.get.common.base-1.sentence-1'>.</a></div></div></div><divclass='texpara'><divid='lib:get-common-base,QuantitySpec'><divid='lib:QuantitySpec,get-common-base'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:QuantitySpec,get-common-base'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:QuantitySpec'title='5.4.3.2 Concepts [qty.spec.concepts]'><spanid='conceptref:QuantitySpec__________________________________________________'><spanclass='texttt'>QuantitySpec</span></span></a><spanclass='keyword'>auto</span> A, <ahref='#concept:QuantitySpec'title='5.4.3.2 Concepts [qty.spec.concepts]'><spanid='conceptref:QuantitySpec___________________________________________________'><spanclass='texttt'>QuantitySpec</span></span></a><spanclass='keyword'>auto</span> B<spanclass='anglebracket'>></span>
<ulclass='itemize'><liid='qty.get.common.base-2.1'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.get.common.base-2.1'>(2.1)</a></div><spanclass="mjx-chtml"><spanclass="mjx-math"><spanclass="mjx-mrow"aria-hidden="true"><spanclass="mjx-msubsup"><spanclass="mjx-base"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-math-I"style="padding-top: 0.225em; padding-bottom: 0.298em;">a</span></span></span><spanclass="mjx-sub"style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-math-I"style="padding-top: 0.225em; padding-bottom: 0.298em;">s</span></span></span></span></span></span></span> be the number of elements in <spanclass='math'><spanclass='mathalpha'>h</span>(<spanclass='texttt'>A</span>)</span>,</li><liid='qty.get.common.base-2.2'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.get.common.base-2.2'>(2.2)</a></div><spanclass="mjx-chtml"><spanclass="mjx-math"><spanclass="mjx-mrow"aria-hidden="true"><spanclass="mjx-msubsup"><spanclass="mjx-base"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-math-I"style="padding-top: 0.446em; padding-bottom: 0.298em;">b</span></span></span><spanclass="mjx-sub"style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-math-I"style="padding-top: 0.225em; padding-bottom: 0.298em;">s</span></span></span></span></span></span></span> be the number of elements in <spanclass='math'><spanclass='mathalpha'>h</span>(<spanclass='texttt'>B</span>)</span>,</li><liid='qty.get.common.base-2.3'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.get.common.base-2.3'>(2.3)</a></div><spanclass='math'><spanclass='mathalpha'>s</span></span> be <spanclass="mjx-chtml"><spanclass="mjx-math"><spanclass="mjx-mrow"aria-hidden="true"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">min</span></span><spanclass="mjx-mo"><spanclass="mjx-char"></span></span><spanclass="mjx-mo"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.446em; padding-bottom: 0.593em;">(</span></span><spanclass="mjx-msubsup"><spanclass="mjx-base"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-math-I"style="padding-top: 0.225em; padding-bottom: 0.298em;">a</span></span></span><spanclass="mjx-sub"style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-math-I"style="padding-top: 0.225em; padding-bottom: 0.298em;">s</span></span></span></span><spanclass="mjx-mo"><spanclass="mjx-char MJXc-TeX-main-R"style="margin-top: -0.144em; padding-bottom: 0.519em;">,</span></span><spanclass="mjx-msubsup MJXc-space1"><spanclass="mjx-base"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-math-I"style="padding-top: 0.446em; padding-bottom: 0.298em;">b</span></span></span><spanclass="mjx-sub"style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-math-I"style="padding-top: 0.225em; padding-bottom: 0.298em;">s</span></span></span></span><spanclass="mjx-mo"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.446em; padding-bottom: 0.593em;">)</span></span></span></span></span>,</li><liid='qty.get.common.base-2.4'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.get.common.base-2.4'>(2.4)</a></div><spanclass='math'><spanclass='mathalpha'>A</span></span> be a tuple of the last <spanclass='math'><spanclass='mathalpha'>s</span></span> elements of <spanclass='math'><spanclass='mathalpha'>h</span>(<spanclass='texttt'>A</span>)</span>, and</li><liid='qty.get.common.base-2.5'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.get.common.base-2.5'>(2.5)</a></div><spanclass='math'><spanclass='mathalpha'>B</span></span> be a tuple of the last <spanclass='m
</code></div></div></div></div><divclass='para'id='qty.is.child.of-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.is.child.of-1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2262'>#</a></div><divclass='texpara'><divid='qty.is.child.of-1.sentence-1'class='sentence'><i>Returns</i>: If <spanclass='math'><spanclass='mathalpha'>h</span>(<spanclass='texttt'>p</span>)</span> has more elements than <spanclass='math'><spanclass='mathalpha'>h</span>(<spanclass='texttt'>ch</span>)</span>, returns <spanclass='texttt'><spanclass='literal'>false</span></span><aclass='hidden_link'href='#qty.is.child.of-1.sentence-1'>.</a></div><divid='qty.is.child.of-1.sentence-2'class='sentence'>Otherwise, let <spanclass='math'><spanclass='mathalpha'>C</span></span> be a tuple of the last <spanclass='math'><spanclass='mathalpha'>s</span></span> elements of <spanclass='math'><spanclass='mathalpha'>h</span>(<spanclass='texttt'>ch</span>)</span>,
where <spanclass='math'><spanclass='mathalpha'>s</span></span> is the number of elements in <spanclass='math'><spanclass='mathalpha'>h</span>(<spanclass='texttt'>p</span>)</span><aclass='hidden_link'href='#qty.is.child.of-1.sentence-2'>.</a></div><divid='qty.is.child.of-1.sentence-3'class='sentence'>Returns <spanclass='texttt'><spanclass="mjx-chtml"><spanclass="mjx-math"><spanclass="mjx-mrow"aria-hidden="true"><spanclass="mjx-msubsup"><spanclass="mjx-base"style="margin-right: -0.045em;"><spanclass="mjx-mi"><spanclass="mjx-char MJXc-TeX-math-I"style="padding-top: 0.519em; padding-bottom: 0.298em; padding-right: 0.045em;">C</span></span></span><spanclass="mjx-sub"style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><spanclass="mjx-mn"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">0</span></span></span></span></span></span></span><spanclass='operator'>=</span><spanclass='operator'>=</span> p</span><aclass='hidden_link'href='#qty.is.child.of-1.sentence-3'>.</a></div></div></div></div></div></div></div><divid='qty.unit'class='section'><h3><aclass='secnum'href='#qty.unit'style='min-width:80pt'>5.4.4</a> Unit <aclass='abbr_ref'href='qty.unit.html'>[qty.unit]</a></h3><divid='qty.unit.general'class='section'><h4><aclass='secnum'href='#qty.unit.general'style='min-width:95pt'>5.4.4.1</a> General <aclass='abbr_ref'href='qty.unit.general.html'>[qty.unit.general]</a></h4><divclass='para'id='qty.unit.general-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.general-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2274'>#</a></div><divclass='texpara'><divid='qty.unit.general-1.sentence-1'class='sentence'>Subclause <ahref='#qty.unit'title='5.4.4 Unit'>[qty.<spanclass='shy'></span>unit]</a> specifies the components
for defining a unit of measurement (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-14">IEC 60050, 112-01-14</a>)<aclass='hidden_link'href='#qty.unit.general-1.sentence-1'>.</a></div></div></div></div><divid='qty.unit.mag'class='section'><h4><aclass='secnum'href='#qty.unit.mag'style='min-width:95pt'>5.4.4.2</a> Magnitude <aclass='abbr_ref'href='qty.unit.mag.html'>[qty.unit.mag]</a></h4><divid='qty.unit.mag.general'class='section'><h4><aclass='secnum'href='#qty.unit.mag.general'style='min-width:110pt'>5.4.4.2.1</a> General <aclass='abbr_ref'href='qty.unit.mag.general.html'>[qty.unit.mag.general]</a></h4><divclass='para'id='qty.unit.mag.general-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.mag.general-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2282'>#</a></div><divclass='texpara'><divid='qty.unit.mag.general-1.sentence-1'class='sentence'>Subclause <ahref='#qty.unit.mag'title='5.4.4.2 Magnitude'>[qty.<spanclass='shy'></span>unit.<spanclass='shy'></span>mag]</a> specifies the components
used to represent the numerical value (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-29">IEC 60050, 112-01-29</a>) of a unit
with support for powers (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=102-02-08">IEC 60050, 102-02-08</a>) of real numbers (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=102-02-05">IEC 60050, 102-02-05</a>)<aclass='hidden_link'href='#qty.unit.mag.general-1.sentence-1'>.</a></div></div></div></div><divid='qty.unit.mag.concepts'class='section'><h4><aclass='secnum'href='#qty.unit.mag.concepts'style='min-width:110pt'>5.4.4.2.2</a> Concepts <aclass='abbr_ref'href='qty.unit.mag.concepts.html'>[qty.unit.mag.concepts]</a></h4><divclass='texpara'><divclass='itemdecl'id='qty.unit.mag.concepts-itemdecl:1'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#qty.unit.mag.concepts-itemdecl:1'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> T<spanclass='anglebracket'>></span>
</span></span></div><divclass='texpara'><divid='qty.unit.mag.types-sentence-1'class='sentence'>A specialization of <spanclass='texttt'>mag_<spanclass='shy'></span>constant</span> represents a real number (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=102-02-05">IEC 60050, 102-02-05</a>)<aclass='hidden_link'href='#qty.unit.mag.types-sentence-1'>.</a></div><divid='qty.unit.mag.types-sentence-2'class='sentence'><spanclass='texttt'>Symbol</span> is its symbol, and
<spanclass='texttt'>Value</span> is (an approximation of) its value<aclass='hidden_link'href='#qty.unit.mag.types-sentence-2'>.</a></div></div><divclass='texpara'><spanid='lib:unit-magnitude'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:unit-magnitude'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
<spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><ahref='#concept:UnitMagnitude'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:UnitMagnitude_'><spanclass='tcode_in_codeblock'>UnitMagnitude</span></span></a><spanclass='keyword'>auto</span><spanclass='keyword'>operator</span><spanclass='operator'>*</span><spanclass='parenthesis'>(</span><i>unit-magnitude</i> lhs, M rhs<spanclass='parenthesis'>)</span>;
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>int</span> Num, <spanclass='keyword'>int</span> Den <spanclass='operator'>=</span><spanclass='literal'>1</span><spanclass='anglebracket'>></span>
</span></span></div><divclass='para'id='qty.unit.mag.types-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.mag.types-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2351'>#</a></div><divclass='texpara'><divid='qty.unit.mag.types-1.sentence-1'class='sentence'>A specialization of <spanclass='texttt'><i>unit-magnitude</i></span>
represents the product of its template arguments<aclass='hidden_link'href='#qty.unit.mag.types-1.sentence-1'>.</a></div></div></div><divclass='para'id='qty.unit.mag.types-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.mag.types-2'>2</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2355'>#</a></div><divclass='texpara'><divid='qty.unit.mag.types-2.sentence-1'class='sentence'>For the purposes of specifying the implementation-defined limits,
representing the number <spanclass="mjx-chtml"><spanclass="mjx-math"><spanclass="mjx-mrow"aria-hidden="true"><spanclass="mjx-msubsup"><spanclass="mjx-base"><spanclass="mjx-texatom"><spanclass="mjx-mrow"><spanclass="mjx-mtext"><spanclass="mjx-char MJXc-TeX-type-R"style="padding-top: 0.372em; padding-bottom: 0.298em;">base</span></span></span></span></span><spanclass="mjx-sup"style="font-size: 70.7%; vertical-align: 0.513em; padding-left: 0px; padding-right: 0.071em;"><spanclass="mjx-texatom"><spanclass="mjx-mrow"><spanclass="mjx-mtext"><spanclass="mjx-char MJXc-TeX-type-R"style="padding-top: 0.225em; padding-bottom: 0.519em;">exp</span></span></span></span></span></span></span></span></span>,
where <spanclass='texttt'><i>base-type</i></span> is a model of <ahref='#concept:MagArg'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:MagArg'><spanclass='texttt'><i>MagArg</i></span></span></a><aclass='hidden_link'href='#qty.unit.mag.types-2.sentence-1'>.</a></div><ulclass='itemize'><liid='qty.unit.mag.types-2.1'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.unit.mag.types-2.1'>(2.1)</a></div><divclass='texpara'><divid='qty.unit.mag.types-2.1.sentence-1'class='sentence'>There is a single term for each <spanclass='texttt'><i>base-type</i></span><aclass='hidden_link'href='#qty.unit.mag.types-2.1.sentence-1'>.</a></div></div></li><liid='qty.unit.mag.types-2.2'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.unit.mag.types-2.2'>(2.2)</a></div><divclass='texpara'><divid='qty.unit.mag.types-2.2.sentence-1'class='sentence'><spanclass='texttt'>exp<spanclass='operator'>.</span>num</span> is not expanded into base<aclass='hidden_link'href='#qty.unit.mag.types-2.2.sentence-1'>.</a></div><divid='qty.unit.mag.types-note-1'class='note'><divclass='texpara'>[<i>Note <ahref='#qty.unit.mag.types-note-1'>1</a></i>: <divid='qty.unit.mag.types-2.2.sentence-2'class='sentence'><spanclass="mjx-chtml"><spanclass="mjx-math"><spanclass="mjx-mrow"aria-hidden="true"><spanclass="mjx-msubsup"><spanclass="mjx-base"><spanclass="mjx-mn"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">2</span></span></span><spanclass="mjx-sup"style="font-size: 70.7%; vertical-align: 0.591em; padding-left: 0px; padding-right: 0.071em;"><spanclass="mjx-mn"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">3</span></span></span></span><spanclass="mjx-mo MJXc-space3"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.077em; padding-bottom: 0.298em;">=</span></span><spanclass="mjx-mn MJXc-space3"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">8</span></span></span></span></span> is not permitted<aclass='hidden_link'href='#qty.unit.mag.types-2.2.sentence-2'>.</a></div> — <i>end note</i>]</div></div></div></li><liid='qty.unit.mag.types-2.3'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.unit.mag.types-2.3'>(2.3)</a></div><divclass='texpara'><divid='qty.unit.mag.types-2.3.sentence-1'class='sentence'><spanclass='texttt'>exp<spanclass='operator'>.</span>den</span> can reduce the base<aclass='hidden_link'href='#qty.unit.mag.types-2.3.sentence-1'>.</a></div><divid='qty.unit.mag.types-note-2'class='note'><divclass='texpara'>[<i>Note <ahref='#qty.unit.mag.types-note-2'>2</a></i>: <divid='qty.unit.mag.types-2.3.sentence-2'class='sentence'><spanclass="mjx-chtml"><spanclass="mjx-math"><spanclass="mjx-mrow"aria-hidden="true"><spanclass="mjx-msubsup"><spanclass="mjx-base"><spanclass="mjx-mn"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">4</span></span></span><spanclass="mjx-sup"style="font-size: 70.7%; vertical-align: 0.607em; padding-left: 0px; padding-right: 0.071em;"><spanclass="mjx-texatom"><spanclass="mjx-mrow"><spanclass="mjx-mn"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">1</span></span><spanclass="mjx-texatom"><spanclass="mjx-mrow"><spanclass="mjx-mo"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.446em; padding-bottom: 0.593em;">/</span></span></span></span><spanclass="mjx-mn"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">2</span></span></span></span></span></span><spanclass="mjx-mo MJXc-space3"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.077em; padding-bottom: 0.298em;">=</span></span><spanclass="mjx-mn MJXc-space3"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;
</code></div></div></div><divclass='para'id='qty.unit.mag.ops-5'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.mag.ops-5'>5</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2453'>#</a></div><divclass='texpara'><divid='qty.unit.mag.ops-5.sentence-1'class='sentence'><i>Constraints</i>: <spanclass='texttt'>V</span> is greater than <spanclass='math'>0</span><aclass='hidden_link'href='#qty.unit.mag.ops-5.sentence-1'>.</a></div></div></div></div><divclass='para'id='qty.unit.mag.ops-6'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.mag.ops-6'>6</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2457'>#</a></div><divclass='texpara'><divid='qty.unit.mag.ops-6.sentence-1'class='sentence'><i>Effects</i>: If <spanclass='texttt'><ahref='#concept:MagConstant'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:MagConstant_'><spanclass='texttt'>MagConstant</span></span></a><spanclass='anglebracket'><</span><spanclass='keyword'>decltype</span><spanclass='parenthesis'>(</span>V<spanclass='parenthesis'>)</span><spanclass='anglebracket'>></span></span> is satisfied,
initializes <spanclass='texttt'>mag</span> with <spanclass='texttt'><spanclass='texttt'><i>unit-magnitude</i></span><spanclass='anglebracket'><</span>V<spanclass='anglebracket'>></span><spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span></span><aclass='hidden_link'href='#qty.unit.mag.ops-6.sentence-1'>.</a></div><divid='qty.unit.mag.ops-6.sentence-2'class='sentence'>Otherwise, initializes <spanclass='texttt'>mag</span> with
an unspecified value equal to <spanclass='texttt'>V</span><aclass='hidden_link'href='#qty.unit.mag.ops-6.sentence-2'>.</a></div></div></div></div><divclass='texpara'><divid='lib:mag_ratio'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:mag_ratio'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span>std<spanclass='operator'>::</span>intmax_t N, std<spanclass='operator'>::</span>intmax_t D<spanclass='anglebracket'>></span>
</code></div></div></div><divclass='para'id='qty.unit.mag.ops-7'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.mag.ops-7'>7</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2473'>#</a></div><divclass='texpara'><divid='qty.unit.mag.ops-7.sentence-1'class='sentence'><i>Effects</i>: Initializes <spanclass='texttt'>mag_<spanclass='shy'></span>ratio</span> with
</code></div></div></div><divclass='para'id='qty.unit.mag.ops-8'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.mag.ops-8'>8</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2486'>#</a></div><divclass='texpara'><divid='qty.unit.mag.ops-8.sentence-1'class='sentence'><i>Constraints</i>: <spanclass='texttt'>Base</span> is greater than <spanclass='math'>0</span><aclass='hidden_link'href='#qty.unit.mag.ops-8.sentence-1'>.</a></div></div></div></div></div><divid='qty.unit.mag.utils'class='section'><h4><aclass='secnum'href='#qty.unit.mag.utils'style='min-width:110pt'>5.4.4.2.5</a> Utilities <aclass='abbr_ref'href='qty.unit.mag.utils.html'>[qty.unit.mag.utils]</a></h4><divclass='texpara'><divid='lib:is-positive-integral-power,UnitMagnitude'><divid='lib:UnitMagnitude,is-positive-integral-power'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:UnitMagnitude,is-positive-integral-power'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><spanclass='keyword'>bool</span><spanclass='texttt'><i>is-positive-integral-power</i></span><spanclass='parenthesis'>(</span><spanclass='texttt'><i>unit-magnitude</i></span> x<spanclass='parenthesis'>)</span>; <spanclass='comment'>// <i>exposition only</i></span>
</code></div></div></div></div><divclass='para'id='qty.unit.mag.utils-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.mag.utils-1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2499'>#</a></div><divclass='texpara'><divid='qty.unit.mag.utils-1.sentence-1'class='sentence'><i>Returns</i>: <spanclass='texttt'><spanclass='literal'>false</span></span> if <spanclass='texttt'>x</span> has a negative or rational exponent, and
</code></div></div></div></div><divclass='para'id='qty.unit.mag.utils-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.mag.utils-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2512'>#</a></div><divclass='texpara'><divid='qty.unit.mag.utils-2.sentence-1'class='sentence'><i>Returns</i>: The largest magnitude <spanclass='texttt'>C</span>
by only positive powers relative to <spanclass='texttt'>C</span><aclass='hidden_link'href='#qty.unit.mag.utils-2.sentence-1'>.</a></div></div></div></div></div></div><divid='qty.unit.traits'class='section'><h4><aclass='secnum'href='#qty.unit.traits'style='min-width:95pt'>5.4.4.3</a> Traits <aclass='abbr_ref'href='qty.unit.traits.html'>[qty.unit.traits]</a></h4><divclass='texpara'><divid='lib:space_before_unit_symbol'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:space_before_unit_symbol'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit_'><spanclass='texttt'>Unit</span></span></a><spanclass='keyword'>auto</span> U<spanclass='anglebracket'>></span>
between the numerical value and the unit symbol<aclass='hidden_link'href='#qty.unit.traits-1.sentence-1'>.</a></div></div></div></div><divclass='para'id='qty.unit.traits-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.traits-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2533'>#</a></div><divclass='texpara'><divid='qty.unit.traits-2.sentence-1'class='sentence'><i>Remarks</i>: Pursuant to <ahref="https://wg21.link/namespace.std">N4971, [namespace.std]</a> (<ahref='spec.ext.html'title='4.1 External'>[spec.<spanclass='shy'></span>ext]</a>),
users may specialize <spanclass='texttt'>space_<spanclass='shy'></span>before_<spanclass='shy'></span>unit_<spanclass='shy'></span>symbol</span>
for cv-unqualified program-defined types<aclass='hidden_link'href='#qty.unit.traits-2.sentence-1'>.</a></div><divid='qty.unit.traits-2.sentence-2'class='sentence'>Such specializations shall be usable in constant expressions (<ahref="https://wg21.link/expr.const">N4971, [expr.const]</a>)
and have type <spanclass='texttt'><spanclass='keyword'>const</span><spanclass='keyword'>bool</span></span><aclass='hidden_link'href='#qty.unit.traits-2.sentence-2'>.</a></div></div></div></div></div><divid='qty.unit.concepts'class='section'><h4><aclass='secnum'href='#qty.unit.concepts'style='min-width:95pt'>5.4.4.4</a> Concepts <aclass='abbr_ref'href='qty.unit.concepts.html'>[qty.unit.concepts]</a></h4><divclass='texpara'><divclass='itemdecl'id='qty.unit.concepts-itemdecl:1'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#qty.unit.concepts-itemdecl:1'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> T<spanclass='anglebracket'>></span>
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> U, <spanclass='keyword'>auto</span> QS<spanclass='anglebracket'>></span>
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:UnitMagnitude'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:UnitMagnitude___________'><spanclass='tcode_in_codeblock'>UnitMagnitude</span></span></a> M, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit___________'><spanclass='tcode_in_codeblock'>Unit</span></span></a> U<spanclass='anglebracket'>></span>
</span></span></div><divclass='para'id='qty.canon.unit-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.canon.unit-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2597'>#</a></div><divclass='texpara'><divid='qty.canon.unit-1.sentence-1'class='sentence'><spanclass='texttt'><i>canonical-unit</i></span> represents a unit expressed in terms of base units (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-18">IEC 60050, 112-01-18</a>)<aclass='hidden_link'href='#qty.canon.unit-1.sentence-1'>.</a></div><divid='qty.canon.unit-note-1'class='note'><divclass='texpara'>[<i>Note <ahref='#qty.canon.unit-note-1'>1</a></i>: <divid='qty.canon.unit-1.sentence-2'class='sentence'>Other types representing units are equal only if they have the same type<aclass='hidden_link'href='#qty.canon.unit-1.sentence-2'>.</a></div><divid='qty.canon.unit-1.sentence-3'class='sentence'><spanclass='texttt'><i>canonical-unit</i></span> is used to implement binary relations other than equality<aclass='hidden_link'href='#qty.canon.unit-1.sentence-3'>.</a></div> — <i>end note</i>]</div></div><divid='qty.canon.unit-1.sentence-4'class='sentence'><spanclass='texttt'>reference_<spanclass='shy'></span>unit</span> is simplified (<ahref='qty.sym.expr.algos.html'title='5.3.4.4 Algorithms'>[qty.<spanclass='shy'></span>sym.<spanclass='shy'></span>expr.<spanclass='shy'></span>algos]</a>)<aclass='hidden_link'href='#qty.canon.unit-1.sentence-4'>.</a></div></div></div><divclass='texpara'><divid='lib:get-canonical-unit,Unit'><divid='lib:Unit,get-canonical-unit'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:Unit,get-canonical-unit'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>consteval</span><spanclass='keyword'>auto</span><spanclass='texttt'><i>get-canonical-unit</i></span><spanclass='parenthesis'>(</span><ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit____________'><spanclass='texttt'>Unit</span></span></a><spanclass='keyword'>auto</span> u<spanclass='parenthesis'>)</span>; <spanclass='comment'>// <i>exposition only</i></span>
</code></div></div></div></div><divclass='para'id='qty.canon.unit-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.canon.unit-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2611'>#</a></div><divclass='texpara'><divid='qty.canon.unit-2.sentence-1'class='sentence'><i>Returns</i>: The instantiation of <spanclass='texttt'><i>canonical-unit</i></span> for <spanclass='texttt'>u</span><aclass='hidden_link'href='#qty.canon.unit-2.sentence-1'>.</a></div></div></div></div></div><divid='qty.scaled.unit'class='section'><h4><aclass='secnum'href='#qty.scaled.unit'style='min-width:110pt'>5.4.4.5.2</a> Scaled <aclass='abbr_ref'href='qty.scaled.unit.html'>[qty.scaled.unit]</a></h4><divclass='texpara'><spanid='lib:scaled_unit'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:scaled_unit'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:UnitMagnitude'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:UnitMagnitude____________'><spanclass='tcode_in_codeblock'>UnitMagnitude</span></span></a><spanclass='keyword'>auto</span> M, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit_____________'><spanclass='tcode_in_codeblock'>Unit</span></span></a> U<spanclass='anglebracket'>></span>
<spanclass='keyword'>requires</span><spanclass='parenthesis'>(</span>M <spanclass='operator'>!</span><spanclass='operator'>=</span><i>unit-magnitude</i><spanclass='anglebracket'><</span><spanclass='anglebracket'>></span><spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span><spanclass='operator'>&</span><spanclass='operator'>&</span> M <spanclass='operator'>!</span><spanclass='operator'>=</span> mag<spanclass='anglebracket'><</span><spanclass='literal'>1</span><spanclass='anglebracket'>></span><spanclass='parenthesis'>)</span>
<spanclass='keyword'>static</span><spanclass='keyword'>constexpr</span><ahref='#concept:UnitMagnitude'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:UnitMagnitude_____________'><spanclass='tcode_in_codeblock'>UnitMagnitude</span></span></a><spanclass='keyword'>auto</span><i>mag</i><spanclass='operator'>=</span> M; <spanclass='comment'>// <i>exposition only</i></span>
<spanclass='keyword'>static</span><spanclass='keyword'>constexpr</span> U <i>reference-unit</i><spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span>; <spanclass='comment'>// <i>exposition only</i></span>
<spanclass='comment'>// if the <spanclass='textsf'><i>qualified-id</i></span><spanclass='tcode_in_codeblock'>U​::​point_<spanclass='shy'></span>origin</span> is valid and denotes an object</span>
</span></span></div><divclass='para'id='qty.scaled.unit-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.scaled.unit-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2635'>#</a></div><divclass='texpara'><divid='qty.scaled.unit-1.sentence-1'class='sentence'><spanclass='texttt'>scaled_<spanclass='shy'></span>unit<spanclass='anglebracket'><</span>M, U<spanclass='anglebracket'>></span></span> is used by the library
to represent the unit <spanclass='math'><spanclass='texttt'>M</span>×<spanclass='texttt'>U</span></span><aclass='hidden_link'href='#qty.scaled.unit-1.sentence-1'>.</a></div></div></div></div><divid='qty.named.unit'class='section'><h4><aclass='secnum'href='#qty.named.unit'style='min-width:110pt'>5.4.4.5.3</a> Named <aclass='abbr_ref'href='qty.named.unit.html'>[qty.named.unit]</a></h4><divclass='texpara'><spanid='lib:named_unit'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:named_unit'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
<spanclass='keyword'>struct</span> named_unit<spanclass='anglebracket'><</span>Symbol, U, PO<spanclass='anglebracket'>></span><spanclass='operator'>:</span><spanclass='keyword'>decltype</span><spanclass='parenthesis'>(</span>U<spanclass='parenthesis'>)</span><spanclass='operator'>::</span><i>base-type</i><spanclass='curlybracket'>{</span>
<spanclass='keyword'>struct</span> named_unit<spanclass='anglebracket'><</span>Symbol, U, QS<spanclass='anglebracket'>></span><spanclass='operator'>:</span><spanclass='keyword'>decltype</span><spanclass='parenthesis'>(</span>U<spanclass='parenthesis'>)</span><spanclass='operator'>::</span><i>base-type</i><spanclass='curlybracket'>{</span>
<spanclass='keyword'>struct</span> named_unit<spanclass='anglebracket'><</span>Symbol, U, QS, PO<spanclass='anglebracket'>></span><spanclass='operator'>:</span><spanclass='keyword'>decltype</span><spanclass='parenthesis'>(</span>U<spanclass='parenthesis'>)</span><spanclass='operator'>::</span><i>base-type</i><spanclass='curlybracket'>{</span>
</span></span></div><divclass='para'id='qty.named.unit-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.named.unit-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2705'>#</a></div><divclass='texpara'><divid='qty.named.unit-1.sentence-1'class='sentence'>A <aclass='hidden_link'href='#def:unit,named'title='5.4.4.5.3 Named [qty.named.unit]'><spanid='def:unit,named'><i>named unit</i></span></a> is a type that models <ahref='#concept:PrefixableUnit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:PrefixableUnit'><spanclass='texttt'>PrefixableUnit</span></span></a><aclass='hidden_link'href='#qty.named.unit-1.sentence-1'>.</a></div><divid='qty.named.unit-1.sentence-2'class='sentence'>A specialization of <spanclass='texttt'>named_<spanclass='shy'></span>unit</span> is used as a base type when defining a named unit<aclass='hidden_link'href='#qty.named.unit-1.sentence-2'>.</a></div></div></div><divclass='para'id='qty.named.unit-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.named.unit-2'>2</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2709'>#</a></div><divclass='texpara'><divid='qty.named.unit-2.sentence-1'class='sentence'>In the following descriptions, let <spanclass='texttt'>U</span> be a named unit defined with an alluded signature<aclass='hidden_link'href='#qty.named.unit-2.sentence-1'>.</a></div><divid='qty.named.unit-2.sentence-2'class='sentence'>The identifier of <spanclass='texttt'>U</span> represents
or special unit name (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-16">IEC 60050, 112-01-16</a>)<aclass='hidden_link'href='#qty.named.unit-2.sentence-2'>.</a></div><divid='qty.named.unit-2.sentence-3'class='sentence'><spanclass='texttt'>Symbol</span> is its unit symbol (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-17">IEC 60050, 112-01-17</a>)<aclass='hidden_link'href='#qty.named.unit-2.sentence-3'>.</a></div></div></div><divclass='para'id='qty.named.unit-3'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.named.unit-3'>3</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2716'>#</a></div><divclass='texpara'><divid='qty.named.unit-3.sentence-1'class='sentence'>The possible arguments to <spanclass='texttt'>named_<spanclass='shy'></span>unit</span> are
without a unit prefix (<a href="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-26">IEC 60050, 112-01-26</a>)<aclass='hidden_link'href='#qty.named.unit-4.sentence-1'>.</a></div><divid='qty.named.unit-4.sentence-2'class='sentence'>The second signature defines a unit
that can be reused by several base quantities<aclass='hidden_link'href='#qty.named.unit-4.sentence-2'>.</a></div><divid='qty.named.unit-4.sentence-3'class='sentence'>The third and fourth signatures with a unit expression argument <i>E</i>
define <spanclass='texttt'>U</span> as implicitly convertible from <i>E</i><aclass='hidden_link'href='#qty.named.unit-4.sentence-3'>.</a></div><divid='qty.named.unit-4.sentence-4'class='sentence'>The first and fourth signatures with a kind of quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-04">IEC 60050, 112-01-04</a>) <i>Q</i>
also restrict <spanclass='texttt'>U</span> to <i>Q</i><aclass='hidden_link'href='#qty.named.unit-4.sentence-4'>.</a></div></div></div><divclass='para'id='qty.named.unit-5'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.named.unit-5'>5</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2739'>#</a></div><divclass='texpara'><divid='qty.named.unit-5.sentence-1'class='sentence'>A point origin argument specifies the default point origin of <spanclass='texttt'>U</span> (<ahref='qty.pt.syn.html'title='5.7.4 Class template quantity_­point'>[qty.<spanclass='shy'></span>pt.<spanclass='shy'></span>syn]</a>)<aclass='hidden_link'href='#qty.named.unit-5.sentence-1'>.</a></div></div></div><divclass='para nonNormativeOnly'id='qty.named.unit-6'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.named.unit-6'>6</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2742'>#</a></div><divclass='texpara'><divid='qty.named.unit-example-1'class='example'><divclass='texpara'>[<i>Example <ahref='#qty.named.unit-example-1'>1</a></i>: <spanclass='codeblock'><spanclass='comment'>// The first signature defines a base unit restricted to a kind of base quantity.</span>
<spanclass='keyword'>inline</span><spanclass='keyword'>constexpr</span><spanclass='keyword'>struct</span> second <spanclass='keyword'>final</span><spanclass='operator'>:</span> named_unit<spanclass='anglebracket'><</span><spanclass='literal'>"s"</span>, kind_of<spanclass='anglebracket'><</span>time<spanclass='anglebracket'>></span><spanclass='anglebracket'>></span><spanclass='curlybracket'>{</span>
<spanclass='curlybracket'>}</span> second;
<spanclass='comment'>// The third and fourth signatures give a name to the unit argument.</span>
</span></span></div><divclass='para'id='qty.prefixed.unit-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.prefixed.unit-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2777'>#</a></div><divclass='texpara'><divid='qty.prefixed.unit-1.sentence-1'class='sentence'><spanclass='texttt'>prefixed_<spanclass='shy'></span>unit<spanclass='anglebracket'><</span>Symbol, M, U<spanclass='anglebracket'>></span></span> represents the unit <spanclass='texttt'>U</span> with a unit prefix (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-26">IEC 60050, 112-01-26</a>)<aclass='hidden_link'href='#qty.prefixed.unit-1.sentence-1'>.</a></div><divid='qty.prefixed.unit-1.sentence-2'class='sentence'><spanclass='texttt'>Symbol</span> is the symbol of the unit prefix<aclass='hidden_link'href='#qty.prefixed.unit-1.sentence-2'>.</a></div><divid='qty.prefixed.unit-1.sentence-3'class='sentence'><spanclass='texttt'>M</span> is the factor of the unit prefix<aclass='hidden_link'href='#qty.prefixed.unit-1.sentence-3'>.</a></div><divid='qty.prefixed.unit-1.sentence-4'class='sentence'>A specialization of <spanclass='texttt'>prefixed_<spanclass='shy'></span>unit</span> is used as a base type when defining a unit prefix<aclass='hidden_link'href='#qty.prefixed.unit-1.sentence-4'>.</a></div><divid='qty.prefixed.unit-example-1'class='example'><divclass='texpara'>[<i>Example <ahref='#qty.prefixed.unit-example-1'>1</a></i>: <spanclass='codeblock'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:PrefixableUnit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:PrefixableUnit__'><spanclass='tcode_in_codeblock'>PrefixableUnit</span></span></a><spanclass='keyword'>auto</span> U<spanclass='anglebracket'>></span>
</span></span></div><divclass='para'id='qty.common.unit-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.common.unit-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2811'>#</a></div><divclass='texpara'><divid='qty.common.unit-1.sentence-1'class='sentence'><spanclass='texttt'>common_<spanclass='shy'></span>unit</span> is used by the library
to encapsulate a conversion factor between units (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-33">IEC 60050, 112-01-33</a>)
common to the operands of quantity addition<aclass='hidden_link'href='#qty.common.unit-1.sentence-1'>.</a></div><divid='qty.common.unit-example-1'class='example'><divclass='texpara'>[<i>Example <ahref='#qty.common.unit-example-1'>1</a></i>: <divid='qty.common.unit-1.sentence-2'class='sentence'>The result of <spanclass='texttt'><spanclass='literal'>1</span><spanclass='operator'>*</span> km <spanclass='operator'>+</span><spanclass='literal'>1</span><spanclass='operator'>*</span> mi</span>
has a common unit <spanclass="mjx-chtml"><spanclass="mjx-math"><spanclass="mjx-mrow"aria-hidden="true"><spanclass="mjx-mo"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.446em; padding-bottom: 0.593em;">[</span></span><spanclass="mjx-mn"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">8</span></span><spanclass="mjx-texatom"><spanclass="mjx-mrow"><spanclass="mjx-mo"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.446em; padding-bottom: 0.593em;">/</span></span></span></span><spanclass="mjx-mn"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.372em; padding-bottom: 0.372em;">125</span></span><spanclass="mjx-mo"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.446em; padding-bottom: 0.593em;">]</span></span><spanclass="mjx-texatom"><spanclass="mjx-mrow"><spanclass="mjx-mtext"><spanclass="mjx-char MJXc-TeX-main-R"style="padding-top: 0.151em; padding-bottom: 0.372em;">m</span></span></span></span></span></span></span>
encapsulated by <spanclass='texttt'>common_<spanclass='shy'></span>unit<spanclass='anglebracket'><</span>mi, km<spanclass='anglebracket'>></span></span><aclass='hidden_link'href='#qty.common.unit-1.sentence-2'>.</a></div> — <i>end example</i>]</div></div><divid='qty.common.unit-1.sentence-3'class='sentence'>
A program that instantiates a specialization of <spanclass='texttt'>common_<spanclass='shy'></span>unit</span>
that is not a possible result of the library specifications
is ill-formed, no diagnostic required<aclass='hidden_link'href='#qty.common.unit-1.sentence-3'>.</a></div></div></div><divclass='texpara'><divclass='itemdecl'id='qty.common.unit-itemdecl:1'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#qty.common.unit-itemdecl:1'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit___________________'><spanclass='texttt'>Unit</span></span></a> U1, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit____________________'><spanclass='texttt'>Unit</span></span></a> U2, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit_____________________'><spanclass='texttt'>Unit</span></span></a><spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='operator'>.</span> Rest<spanclass='anglebracket'>></span>
</code></div></div><divclass='para'id='qty.common.unit-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.common.unit-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2831'>#</a></div><divclass='texpara'><divid='qty.common.unit-2.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
<spanclass='codeblock'><spanclass='keyword'>constexpr</span><spanclass='keyword'>auto</span> res <spanclass='operator'>=</span><spanclass='squarebracket'>[</span><spanclass='squarebracket'>]</span><spanclass='curlybracket'>{</span>
</span></div></div></div></div><divclass='para'id='qty.common.unit-3'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.common.unit-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2850'>#</a></div><divclass='texpara'><divid='qty.common.unit-3.sentence-1'class='sentence'><i>Remarks</i>: The expression in the <spanclass='textsf'><i>requires-clause</i></span> is equivalent to:
</span></span></div><divclass='para'id='qty.derived.unit-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.derived.unit-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2879'>#</a></div><divclass='texpara'><divid='qty.derived.unit-1.sentence-1'class='sentence'><spanclass='texttt'>derived_<spanclass='shy'></span>unit</span> is used by the library
to represent a derived unit (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-19">IEC 60050, 112-01-19</a>)<aclass='hidden_link'href='#qty.derived.unit-1.sentence-1'>.</a></div><divid='qty.derived.unit-example-1'class='example'><divclass='texpara'>[<i>Example <ahref='#qty.derived.unit-example-1'>1</a></i>: <spanclass='codeblock'><spanclass='keyword'>using</span><spanclass='keyword'>namespace</span> si<spanclass='operator'>::</span>unit_symbols;
<spanclass='keyword'>int</span> x <spanclass='operator'>=</span> m <spanclass='operator'>*</span> m; <spanclass='comment'>// error: cannot construct from <spanclass='tcode_in_codeblock'>derived_<spanclass='shy'></span>unit<power<si​::​metre, 2>></span></span>
<spanclass='keyword'>int</span> y <spanclass='operator'>=</span> m <spanclass='operator'>*</span> s; <spanclass='comment'>// error: cannot construct from <spanclass='tcode_in_codeblock'>derived_<spanclass='shy'></span>unit<si​::​metre, si​::​second></span></span>
<spanclass='keyword'>int</span> z <spanclass='operator'>=</span> m <spanclass='operator'>/</span> s; <spanclass='comment'>// error: cannot construct from <spanclass='tcode_in_codeblock'>derived_<spanclass='shy'></span>unit<si​::​metre, per<si​::​second>></span></span>
A program that instantiates a specialization of <spanclass='texttt'>derived_<spanclass='shy'></span>unit</span>
that is not a possible result of the library specifications
is ill-formed, no diagnostic required<aclass='hidden_link'href='#qty.derived.unit-1.sentence-2'>.</a></div></div></div></div><divid='qty.unit.one'class='section'><h4><aclass='secnum'href='#qty.unit.one'style='min-width:110pt'>5.4.4.5.7</a> One <aclass='abbr_ref'href='qty.unit.one.html'>[qty.unit.one]</a></h4><divclass='texpara'><spanid='lib:one'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:one'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
<spanclass='keyword'>struct</span> one <spanclass='keyword'>final</span><spanclass='operator'>:</span><i>derived-unit-impl</i><spanclass='anglebracket'><</span><spanclass='anglebracket'>></span><spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span>;
</span></span></div><divclass='para'id='qty.unit.one-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.one-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2905'>#</a></div><divclass='texpara'><divid='qty.unit.one-1.sentence-1'class='sentence'><spanclass='texttt'>one</span> represents the base unit (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-18">IEC 60050, 112-01-18</a>) of a quantity of dimension one (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-13">IEC 60050, 112-01-13</a>)<aclass='hidden_link'href='#qty.unit.one-1.sentence-1'>.</a></div></div></div></div></div><divid='qty.unit.ops'class='section'><h4><aclass='secnum'href='#qty.unit.ops'style='min-width:95pt'>5.4.4.6</a> Operations <aclass='abbr_ref'href='qty.unit.ops.html'>[qty.unit.ops]</a></h4><divclass='texpara'><spanid='lib:unit-interface'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:unit-interface'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:UnitMagnitude'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:UnitMagnitude_______________'><spanclass='tcode_in_codeblock'>UnitMagnitude</span></span></a> M, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit_______________________'><spanclass='tcode_in_codeblock'>Unit</span></span></a> U<spanclass='anglebracket'>></span>
<spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit________________________'><spanclass='tcode_in_codeblock'>Unit</span></span></a><spanclass='keyword'>auto</span><spanclass='keyword'>operator</span><spanclass='operator'>*</span><spanclass='parenthesis'>(</span>M, U u<spanclass='parenthesis'>)</span>;
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:UnitMagnitude'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:UnitMagnitude_________________'><spanclass='tcode_in_codeblock'>UnitMagnitude</span></span></a> M, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit___________________________'><spanclass='tcode_in_codeblock'>Unit</span></span></a> U<spanclass='anglebracket'>></span>
<spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit____________________________'><spanclass='tcode_in_codeblock'>Unit</span></span></a><spanclass='keyword'>auto</span><spanclass='keyword'>operator</span><spanclass='operator'>/</span><spanclass='parenthesis'>(</span>M mag, U u<spanclass='parenthesis'>)</span>;
</span></span></div><divclass='texpara'><divid='lib:Unit,operator*'><divid='lib:operator*,Unit'><divid='lib:UnitMagnitude,operator*_'><divid='lib:operator*,UnitMagnitude_'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:operator*,UnitMagnitude_'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:UnitMagnitude'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:UnitMagnitude__________________'><spanclass='texttt'>UnitMagnitude</span></span></a> M, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit_______________________________________'><spanclass='texttt'>Unit</span></span></a> U<spanclass='anglebracket'>></span>
<spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit________________________________________'><spanclass='texttt'>Unit</span></span></a><spanclass='keyword'>auto</span><spanclass='keyword'>operator</span><spanclass='operator'>*</span><spanclass='parenthesis'>(</span>M, U u<spanclass='parenthesis'>)</span>;
</code></div></div></div></div></div></div><divclass='para'id='qty.unit.ops-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.ops-1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2949'>#</a></div><divclass='texpara'><divid='qty.unit.ops-1.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
</code></div></div><divclass='para'id='qty.unit.ops-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.ops-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2970'>#</a></div><divclass='texpara'><divid='qty.unit.ops-2.sentence-1'class='sentence'><i>Recommended practice</i>: Suggest swapping the operands<aclass='hidden_link'href='#qty.unit.ops-2.sentence-1'>.</a></div></div></div></div><divclass='texpara'><divid='lib:Unit,operator/'><divid='lib:operator/,Unit'><divid='lib:UnitMagnitude,operator/_'><divid='lib:operator/,UnitMagnitude_'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:operator/,UnitMagnitude_'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:UnitMagnitude'title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><spanid='conceptref:UnitMagnitude____________________'><spanclass='texttt'>UnitMagnitude</span></span></a> M, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit___________________________________________'><spanclass='texttt'>Unit</span></span></a> U<spanclass='anglebracket'>></span>
<spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit____________________________________________'><spanclass='texttt'>Unit</span></span></a><spanclass='keyword'>auto</span><spanclass='keyword'>operator</span><spanclass='operator'>/</span><spanclass='parenthesis'>(</span>M mag, U u<spanclass='parenthesis'>)</span>;
</code></div></div></div></div><divclass='para'id='qty.unit.cmp-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.cmp-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3101'>#</a></div><divclass='texpara'><divid='qty.unit.cmp-2.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
<spanclass='keyword'>consteval</span><spanclass='keyword'>bool</span> convertible<spanclass='parenthesis'>(</span>From from, To to<spanclass='parenthesis'>)</span>;
</code></div></div></div></div><divclass='para'id='qty.unit.cmp-3'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.cmp-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3119'>#</a></div><divclass='texpara'><divid='qty.unit.cmp-3.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
<ulclass='itemize'><liid='qty.unit.obs-3.1'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.unit.obs-3.1'>(3.1)</a></div><spanclass='texttt'>u1</span> be <spanclass='texttt'>us<spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='squarebracket'>[</span><spanclass='literal'>0</span><spanclass='squarebracket'>]</span></span>,</li><liid='qty.unit.obs-3.2'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.unit.obs-3.2'>(3.2)</a></div><spanclass='texttt'>u2</span> be <spanclass='texttt'>us<spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='squarebracket'>[</span><spanclass='literal'>1</span><spanclass='squarebracket'>]</span></span>,</li><liid='qty.unit.obs-3.3'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.unit.obs-3.3'>(3.3)</a></div><spanclass='texttt'>U1</span> be <spanclass='texttt'><spanclass='keyword'>decltype</span><spanclass='parenthesis'>(</span>u1<spanclass='parenthesis'>)</span></span>,</li><liid='qty.unit.obs-3.4'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.unit.obs-3.4'>(3.4)</a></div><spanclass='texttt'>U2</span> be <spanclass='texttt'><spanclass='keyword'>decltype</span><spanclass='parenthesis'>(</span>u2<spanclass='parenthesis'>)</span></span>, and</li><liid='qty.unit.obs-3.5'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#qty.unit.obs-3.5'>(3.5)</a></div><spanclass='texttt'>rest</span> be a pack denoting the elements of <spanclass='texttt'>us</span> without <spanclass='texttt'>u1</span> and <spanclass='texttt'>u2</span><aclass='hidden_link'href='#qty.unit.obs-3.sentence-1'>.</a></li></ul></div></div></div></div><divclass='para'id='qty.unit.obs-4'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.obs-4'>4</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3179'>#</a></div><divclass='texpara'><divid='qty.unit.obs-4.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
</span></div></div></div></div><divclass='para'id='qty.unit.obs-5'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.obs-5'>5</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3218'>#</a></div><divclass='texpara'><divid='qty.unit.obs-5.sentence-1'class='sentence'><i>Remarks</i>: The expression in the <spanclass='textsf'><i>requires-clause</i></span> is equivalent to:
</code></div></div></div></div><divclass='para'id='assoc.qty-1'><divclass='marginalizedparent'><aclass='marginalized'href='#assoc.qty-1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3237'>#</a></div><divclass='texpara'><divid='assoc.qty-1.sentence-1'class='sentence'><i>Returns</i>: <ulclass='itemize'><liid='assoc.qty-1.1'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#assoc.qty-1.1'>(1.1)</a></div><divclass='texpara'><divid='assoc.qty-1.1.sentence-1'class='sentence'>If <spanclass='texttt'>U<spanclass='operator'>​::​</span><spanclass='texttt'><i>quantity-spec</i></span></span> is a valid expression,
returns <spanclass='texttt'><spanclass='literal'>true</span></span><aclass='hidden_link'href='#assoc.qty-1.1.sentence-1'>.</a></div></div></li><liid='assoc.qty-1.2'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#assoc.qty-1.2'>(1.2)</a></div><divclass='texpara'><divid='assoc.qty-1.2.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'>U<spanclass='operator'>​::​</span><spanclass='texttt'><i>reference-unit</i></span></span> is a valid expression,
</span></div></div></li><liid='assoc.qty-1.3'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#assoc.qty-1.3'>(1.3)</a></div><divclass='texpara'><divid='assoc.qty-1.3.sentence-1'class='sentence'>Otherwise, if
is <spanclass='texttt'><spanclass='literal'>true</span></span>,
let <spanclass='texttt'>Nums</span> and <spanclass='texttt'>Dens</span>
be packs denoting the template arguments of
<spanclass='texttt'>U<spanclass='operator'>​::​</span><spanclass='texttt'><i>nums</i></span></span> and <spanclass='texttt'>U<spanclass='operator'>​::​</span><spanclass='texttt'><i>dens</i></span></span>, respectively<aclass='hidden_link'href='#assoc.qty-1.3.sentence-1'>.</a></div><divid='assoc.qty-1.3.sentence-2'class='sentence'>Returns
</code></div></div></div></div><divclass='para'id='assoc.qty-2'><divclass='marginalizedparent'><aclass='marginalized'href='#assoc.qty-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3273'>#</a></div><divclass='texpara'><divid='assoc.qty-2.sentence-1'class='sentence'><i>Returns</i>: <ulclass='itemize'><liid='assoc.qty-2.1'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#assoc.qty-2.1'>(2.1)</a></div>If <spanclass='texttt'>U</span> is of the form <spanclass='texttt'>common_<spanclass='shy'></span>unit<spanclass='anglebracket'><</span>Us<spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='anglebracket'>></span></span>,
</span></li><liid='assoc.qty-2.2'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#assoc.qty-2.2'>(2.2)</a></div>Otherwise, if <spanclass='texttt'>U<spanclass='operator'>​::​</span><spanclass='texttt'><i>quantity-spec</i></span></span> is a valid expression,
</span></li><liid='assoc.qty-2.3'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#assoc.qty-2.3'>(2.3)</a></div>Otherwise, if <spanclass='texttt'>U<spanclass='operator'>​::​</span><spanclass='texttt'><i>reference-unit</i></span></span> is a valid expression,
</span></li><liid='assoc.qty-2.4'><divclass='marginalizedparent'style='left:-39mm'><aclass='marginalized'href='#assoc.qty-2.4'>(2.4)</a></div>Otherwise, if
</span></li></ul></div></div></div></div></div><divid='qty.unit.sym.fmt'class='section'><h4><aclass='secnum'href='#qty.unit.sym.fmt'style='min-width:95pt'>5.4.4.10</a> Symbol formatting <aclass='abbr_ref'href='qty.unit.sym.fmt.html'>[qty.unit.sym.fmt]</a></h4><divclass='texpara'><divid='lib:Unit,unit_symbol_to'><divid='lib:unit_symbol_to,Unit'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:unit_symbol_to,Unit'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> CharT <spanclass='operator'>=</span><spanclass='keyword'>char</span>, std<spanclass='operator'>::</span>output_iterator<spanclass='anglebracket'><</span>CharT<spanclass='anglebracket'>></span> Out, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit_________________________________________________________________________'><spanclass='texttt'>Unit</span></span></a> U<spanclass='anglebracket'>></span>
<spanclass='keyword'>constexpr</span> Out unit_symbol_to<spanclass='parenthesis'>(</span>Out out, U u, <spanclass='keyword'>const</span> unit_symbol_formatting<spanclass='operator'>&</span> fmt <spanclass='operator'>=</span><spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span><spanclass='parenthesis'>)</span>;
</code></div></div></div></div><divclass='para'id='qty.unit.sym.fmt-3'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.unit.sym.fmt-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3335'>#</a></div><divclass='texpara'><divid='qty.unit.sym.fmt-3.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
</code></div></div><divclass='texpara'><divid='concepts-sentence-1'class='sentence'>A type <spanclass='texttt'>T</span> that satisfies <spanclass='texttt'>Reference</span>
represents the reference of a quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-01">IEC 60050, 112-01-01</a>)<aclass='hidden_link'href='#concepts-sentence-1'>.</a></div></div><divclass='texpara'><divclass='itemdecl'id='concept:ReferenceOf'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#concept:ReferenceOf'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> T, <spanclass='keyword'>auto</span> QS<spanclass='anglebracket'>></span>
</code></div></div></div><divid='syn'class='section'><h3><aclass='secnum'href='#syn'style='min-width:80pt'>5.4.6</a> Class template <spanclass='texttt'>reference</span><aclass='abbr_ref'href='qty.ref.syn.html'>[qty.ref.syn]</a></h3><divclass='texpara'><spanid='lib:reference,cbrt'><spanid='lib:cbrt,reference'><spanid='lib:reference,sqrt'><spanid='lib:sqrt,reference'><spanid='lib:reference,pow'><spanid='lib:pow,reference'><spanid='lib:reference,inverse'><spanid='lib:inverse,reference'><spanid='lib:AssociatedUnit,operator/'><spanid='lib:operator/,AssociatedUnit'><spanid='lib:reference,operator/'><spanid='lib:operator/,reference'><spanid='lib:AssociatedUnit,operator*'><spanid='lib:operator*,AssociatedUnit'><spanid='lib:reference,operator*'><spanid='lib:operator*,reference'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:operator*,reference'>🔗</a></div><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:QuantitySpec'title='5.4.3.2 Concepts [qty.spec.concepts]'><spanid='conceptref:QuantitySpec_________________________________________________________'><spanclass='tcode_in_codeblock'>QuantitySpec</span></span></a><spanclass='keyword'>auto</span> Q, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit___________________________________________________________________________'><spanclass='tcode_in_codeblock'>Unit</span></span></a><spanclass='keyword'>auto</span> U<spanclass='anglebracket'>></span>
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span><ahref='#concept:QuantitySpec'title='5.4.3.2 Concepts [qty.spec.concepts]'><spanid='conceptref:QuantitySpec__________________________________________________________'><spanclass='tcode_in_codeblock'>QuantitySpec</span></span></a> Q, <ahref='#concept:Unit'title='5.4.4.4 Concepts [qty.unit.concepts]'><spanid='conceptref:Unit____________________________________________________________________________'><spanclass='tcode_in_codeblock'>Unit</span></span></a> U<spanclass='anglebracket'>></span>
<spanclass='keyword'>template</span><spanclass='anglebracket'><</span>std<spanclass='operator'>::</span>intmax_t Num, std<spanclass='operator'>::</span>intmax_t Den <spanclass='operator'>=</span><spanclass='literal'>1</span><spanclass='anglebracket'>></span>
<spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><spanclass='keyword'>bool</span><spanclass='keyword'>operator</span><spanclass='operator'>=</span><spanclass='operator'>=</span><spanclass='parenthesis'>(</span>reference, U2 u2<spanclass='parenthesis'>)</span>;
<spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><spanclass='keyword'>bool</span> convertible<spanclass='parenthesis'>(</span>reference, U2 u2<spanclass='parenthesis'>)</span>;
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><divclass='para'id='syn-1'><divclass='marginalizedparent'><aclass='marginalized'href='#syn-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3431'>#</a></div><divclass='texpara'><divid='syn-1.sentence-1'class='sentence'><spanclass='texttt'>reference<spanclass='anglebracket'><</span>Q, U<spanclass='anglebracket'>></span></span> represents the reference of a quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-01">IEC 60050, 112-01-01</a>)<aclass='hidden_link'href='#syn-1.sentence-1'>.</a></div><divid='syn-1.sentence-2'class='sentence'>The unit of measurement <spanclass='texttt'>U</span> (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-14">IEC 60050, 112-01-14</a>)
is used to measure a value of the quantity <spanclass='texttt'>Q</span> (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-28">IEC 60050, 112-01-28</a>)<aclass='hidden_link'href='#syn-1.sentence-2'>.</a></div><divid='syn-note-1'class='note'><divclass='texpara'>[<i>Note <ahref='#syn-note-1'>1</a></i>: <divid='syn-1.sentence-3'class='sentence'><spanclass='texttt'>reference</span> is typically implicitly instantiated
when specifying that a unit measures a more specific quantity<aclass='hidden_link'href='#syn-1.sentence-3'>.</a></div><divid='syn-example-1'class='example'><divclass='texpara'>[<i>Example <ahref='#syn-example-1'>1</a></i>: <spanclass='codeblock'><spanclass='keyword'>using</span><spanclass='keyword'>namespace</span> si<spanclass='operator'>::</span>unit_symbols;
<spanclass='keyword'>auto</span> x <spanclass='operator'>=</span><spanclass='literal'>1</span><spanclass='operator'>*</span> m; <spanclass='comment'>// measures a length</span>
<spanclass='keyword'>auto</span> y <spanclass='operator'>=</span><spanclass='literal'>1</span><spanclass='operator'>*</span> isq<spanclass='operator'>::</span>width<spanclass='squarebracket'>[</span>m<spanclass='squarebracket'>]</span>; <spanclass='comment'>// measures a width</span>
<spanclass='keyword'>auto</span> z <spanclass='operator'>=</span><spanclass='literal'>1</span><spanclass='operator'>*</span> isq<spanclass='operator'>::</span>diameter<spanclass='squarebracket'>[</span>m<spanclass='squarebracket'>]</span>; <spanclass='comment'>// measures a diameter</span>
</span> — <i>end example</i>]</div></div> — <i>end note</i>]</div></div></div></div></div><divid='ops'class='section'><h3><aclass='secnum'href='#ops'style='min-width:80pt'>5.4.7</a> Operations <aclass='abbr_ref'href='qty.ref.ops.html'>[qty.ref.ops]</a></h3><divclass='para'id='ops-1'><divclass='marginalizedparent'><aclass='marginalized'href='#ops-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3450'>#</a></div><divclass='texpara'><divid='ops-1.sentence-1'class='sentence'>Each member function with a <spanclass='textsf'><i>trailing-return-type</i></span>
of <spanclass='texttt'><spanclass='operator'>-</span><spanclass='anglebracket'>></span><spanclass='texttt'><i>reference-t</i></span><spanclass='anglebracket'><</span>T<spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='anglebracket'>></span></span>
</code></div></div></div></div></div></div><divclass='para'id='ops-2'><divclass='marginalizedparent'><aclass='marginalized'href='#ops-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3465'>#</a></div><divclass='texpara'><divid='ops-2.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
</code></div></div></div></div></div></div><divclass='para'id='ops-3'><divclass='marginalizedparent'><aclass='marginalized'href='#ops-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3481'>#</a></div><divclass='texpara'><divid='ops-3.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
<spanclass='keyword'>constexpr</span><ahref='qty.syn.html#concept:Quantity'title='5.6.3 Class template quantity [qty.syn]'><spanid='conceptref:Quantity______'><spanclass='texttt'>Quantity</span></span></a><spanclass='keyword'>auto</span><spanclass='keyword'>operator</span><spanclass='operator'>*</span><spanclass='parenthesis'>(</span>FwdQ<spanclass='operator'>&</span><spanclass='operator'>&</span> q, R<spanclass='parenthesis'>)</span>;
<spanclass='keyword'>constexpr</span><ahref='qty.syn.html#concept:Quantity'title='5.6.3 Class template quantity [qty.syn]'><spanid='conceptref:Quantity________'><spanclass='texttt'>Quantity</span></span></a><spanclass='keyword'>auto</span><spanclass='keyword'>operator</span><spanclass='operator'>/</span><spanclass='parenthesis'>(</span>FwdQ<spanclass='operator'>&</span><spanclass='operator'>&</span> q, R<spanclass='parenthesis'>)</span>;
</code></div></div></div></div></div></div></div></div></div></div><divclass='para'id='ops-4'><divclass='marginalizedparent'><aclass='marginalized'href='#ops-4'>4</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3499'>#</a></div><divclass='texpara'><divid='ops-4.sentence-1'class='sentence'>Let <spanclass='texttt'>@</span> be the <spanclass='textsf'><i>operator</i></span><aclass='hidden_link'href='#ops-4.sentence-1'>.</a></div></div></div></div><divclass='para'id='ops-5'><divclass='marginalizedparent'><aclass='marginalized'href='#ops-5'>5</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3502'>#</a></div><divclass='texpara'><divid='ops-5.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
<spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><spanclass='keyword'>bool</span><spanclass='keyword'>operator</span><spanclass='operator'>=</span><spanclass='operator'>=</span><spanclass='parenthesis'>(</span>reference, U2 u2<spanclass='parenthesis'>)</span>;
<spanclass='keyword'>friend</span><spanclass='keyword'>consteval</span><spanclass='keyword'>bool</span> convertible<spanclass='parenthesis'>(</span>reference, U2 u2<spanclass='parenthesis'>)</span>;
</code></div></div></div></div><divclass='para'id='obs-1'><divclass='marginalizedparent'><aclass='marginalized'href='#obs-1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3608'>#</a></div><divclass='texpara'><divid='obs-1.sentence-1'class='sentence'><i>Returns</i>: <spanclass='texttt'>Q<spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span></span><aclass='hidden_link'href='#obs-1.sentence-1'>.</a></div></div></div></div><divclass='texpara'><divid='lib:reference,get_unit'><divid='lib:get_unit,reference'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:get_unit,reference'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> Q, <spanclass='keyword'>typename</span> U<spanclass='anglebracket'>></span>
</code></div></div></div></div><divclass='para'id='obs-3'><divclass='marginalizedparent'><aclass='marginalized'href='#obs-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3634'>#</a></div><divclass='texpara'><divid='obs-3.sentence-1'class='sentence'><i>Returns</i>: <spanclass='texttt'>get_<spanclass='shy'></span>common_<spanclass='shy'></span>unit<spanclass='parenthesis'>(</span>u1, u2, rest<spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='operator'>.</span><spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#obs-3.sentence-1'>.</a></div></div></div></div><divclass='para'id='obs-4'><divclass='marginalizedparent'><aclass='marginalized'href='#obs-4'>4</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3638'>#</a></div><divclass='texpara'><divid='obs-4.sentence-1'class='sentence'><i>Remarks</i>: The expression in the <spanclass='textsf'><i>requires-clause</i></span> is equivalent to:
</span></div></div></div></div><divclass='para'id='obs-6'><divclass='marginalizedparent'><aclass='marginalized'href='#obs-6'>6</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3666'>#</a></div><divclass='texpara'><divid='obs-6.sentence-1'class='sentence'><i>Remarks</i>: The expression in the <spanclass='textsf'><i>requires-clause</i></span> is equivalent to: