<!DOCTYPE html><htmllang='en'><head><title>[qty.rep]</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.5</a> Representation <aclass='abbr_ref'>[qty.rep]</a></h2><divid='general'class='section'><h3><aclass='secnum'href='#general'style='min-width:80pt'>5.5.1</a> General <aclass='abbr_ref'href='qty.rep.general.html'>[qty.rep.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#L3682'>#</a></div><divclass='texpara'><divid='general-1.sentence-1'class='sentence'>Subclause [qty.<spanclass='shy'></span>rep] specifies the components
used to constrain the numerical value of a quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-29">IEC 60050, 112-01-29</a>)<aclass='hidden_link'href='#general-1.sentence-1'>.</a></div></div></div></div><divid='traits'class='section'><h3><aclass='secnum'href='#traits'style='min-width:80pt'>5.5.2</a> Traits <aclass='abbr_ref'href='qty.rep.traits.html'>[qty.rep.traits]</a></h3><divid='qty.fp.traits'class='section'><h4><aclass='secnum'href='#qty.fp.traits'style='min-width:95pt'>5.5.2.1</a> Floating-point <aclass='abbr_ref'href='qty.fp.traits.html'>[qty.fp.traits]</a></h4><divclass='texpara'><divclass='itemdecl'id='qty.fp.traits-itemdecl:1'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#qty.fp.traits-itemdecl:1'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> T<spanclass='anglebracket'>></span>
<spanclass='keyword'>struct</span><spanclass='texttt'><i>actual-value-type</i></span><spanclass='operator'>:</span><spanclass='texttt'><i>cond-value-type</i></span><spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span><spanclass='curlybracket'>{</span><spanclass='curlybracket'>}</span>; <spanclass='comment'>// see <ahref="https://wg21.link/readable.traits">N4971, [readable.traits]</a></span>
</code></div></div><divclass='para'id='qty.fp.traits-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.fp.traits-1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3708'>#</a></div><divclass='texpara'><divid='qty.fp.traits-1.sentence-1'class='sentence'><spanclass='texttt'>quantity</span> and <spanclass='texttt'>quantity_<spanclass='shy'></span>point</span> use <spanclass='texttt'>treat_<spanclass='shy'></span>as_<spanclass='shy'></span>floating_<spanclass='shy'></span>point</span>
to help determine whether implicit conversions are allowed among them<aclass='hidden_link'href='#qty.fp.traits-1.sentence-1'>.</a></div></div></div></div><divclass='para'id='qty.fp.traits-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.fp.traits-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3712'>#</a></div><divclass='texpara'><divid='qty.fp.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'>treat_<spanclass='shy'></span>as_<spanclass='shy'></span>floating_<spanclass='shy'></span>point</span>
for cv-unqualified program-defined types<aclass='hidden_link'href='#qty.fp.traits-2.sentence-1'>.</a></div><divid='qty.fp.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.fp.traits-2.sentence-2'>.</a></div></div></div></div></div><divid='qty.char.traits'class='section'><h4><aclass='secnum'href='#qty.char.traits'style='min-width:95pt'>5.5.2.2</a> Quantity character <aclass='abbr_ref'href='qty.char.traits.html'>[qty.char.traits]</a></h4><divclass='texpara'><divid='lib:disable_vector'><divid='lib:disable_complex'><divid='lib:disable_scalar'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:disable_scalar'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> T<spanclass='anglebracket'>></span>
</code></div></div></div></div></div><divclass='para'id='qty.char.traits-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.char.traits-1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3736'>#</a></div><divclass='texpara'><divid='qty.char.traits-1.sentence-1'class='sentence'>Some quantities are defined as having a numerical value (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-29">IEC 60050, 112-01-29</a>) of a specific set (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=102-01-02">IEC 60050, 102-01-02</a>)<aclass='hidden_link'href='#qty.char.traits-1.sentence-1'>.</a></div><divid='qty.char.traits-1.sentence-2'class='sentence'>The representation concepts use these traits
to help determine the sets <spanclass='texttt'>T</span> represents<aclass='hidden_link'href='#qty.char.traits-1.sentence-2'>.</a></div></div></div></div><divclass='para'id='qty.char.traits-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.char.traits-2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3741'>#</a></div><divclass='texpara'><divid='qty.char.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>),
for cv-unqualified program-defined types<aclass='hidden_link'href='#qty.char.traits-2.sentence-1'>.</a></div><divid='qty.char.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.char.traits-2.sentence-2'>.</a></div></div></div></div><divclass='para nonNormativeOnly'id='qty.char.traits-3'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.char.traits-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3749'>#</a></div><divclass='texpara'><divid='qty.char.traits-note-1'class='note'><divclass='texpara'>[<i>Note <ahref='#qty.char.traits-note-1'>1</a></i>: <divid='qty.char.traits-3.sentence-1'class='sentence'>These templates prevent use of representation types with the library
that satisfy but do not in fact model their corresponding concept<aclass='hidden_link'href='#qty.char.traits-3.sentence-1'>.</a></div> — <i>end note</i>]</div></div></div></div></div></div><divid='qty.val.traits'class='section'><h4><aclass='secnum'href='#qty.val.traits'style='min-width:95pt'>5.5.2.3</a> Values <aclass='abbr_ref'href='qty.val.traits.html'>[qty.val.traits]</a></h4><divclass='para'id='qty.val.traits-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.val.traits-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3758'>#</a></div><divclass='texpara'><divid='qty.val.traits-1.sentence-1'class='sentence'><spanclass='texttt'>quantity</span> and <spanclass='texttt'>quantity_<spanclass='shy'></span>point</span> use <spanclass='texttt'>representation_<spanclass='shy'></span>values</span>
to construct special values of its representation type<aclass='hidden_link'href='#qty.val.traits-1.sentence-1'>.</a></div></div><divclass='texpara'><spanclass='codeblock'><spanclass='keyword'>namespace</span> mp_units <spanclass='curlybracket'>{</span>
also apply to <spanclass='texttt'>representation_<spanclass='shy'></span>values<spanclass='anglebracket'><</span>Rep<spanclass='anglebracket'>></span></span><aclass='hidden_link'href='#qty.val.traits-2.sentence-1'>.</a></div></div></div><divclass='texpara'><divclass='itemdecl'id='qty.val.traits-itemdecl:1'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#qty.val.traits-itemdecl:1'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>static</span><spanclass='keyword'>constexpr</span> Rep one<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='keyword'>noexcept</span>;
</code></div></div><divclass='para'id='qty.val.traits-3'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.val.traits-3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3782'>#</a></div><divclass='texpara'><divid='qty.val.traits-3.sentence-1'class='sentence'><i>Returns</i>: <spanclass='texttt'>Rep<spanclass='parenthesis'>(</span><spanclass='literal'>1</span><spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#qty.val.traits-3.sentence-1'>.</a></div></div></div></div><divclass='para'id='qty.val.traits-4'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.val.traits-4'>4</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3786'>#</a></div><divclass='texpara'><divid='qty.val.traits-4.sentence-1'class='sentence'><i>Remarks</i>: The value returned shall be the neutral element for multiplication (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=102-01-19">IEC 60050, 102-01-19</a>)<aclass='hidden_link'href='#qty.val.traits-4.sentence-1'>.</a></div></div></div></div></div></div><divid='cpos'class='section'><h3><aclass='secnum'href='#cpos'style='min-width:80pt'>5.5.3</a> Customization point objects <aclass='abbr_ref'href='qty.rep.cpos.html'>[qty.rep.cpos]</a></h3><divid='cpos.general'class='section'><h4><aclass='secnum'href='#cpos.general'style='min-width:95pt'>5.5.3.1</a> General <aclass='abbr_ref'href='qty.rep.cpos.general.html'>[qty.rep.cpos.general]</a></h4><divclass='para'id='cpos.general-1'><divclass='marginalizedparent'><aclass='marginalized'href='#cpos.general-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3795'>#</a></div><divclass='texpara'><divid='cpos.general-1.sentence-1'class='sentence'>Within subclause <ahref='#cpos'title='5.5.3 Customization point objects'>[qty.<spanclass='shy'></span>rep.<spanclass='shy'></span>cpos]</a>,
<aclass='hidden_link'href='#def:reified_object'id='def:reified_object'><i>reified object</i></a> is as defined in <ahref="https://wg21.link/range.access.general">N4971, [range.access.general]</a><aclass='hidden_link'href='#cpos.general-1.sentence-1'>.</a></div></div></div></div><divid='qty.real.cpo'class='section'><h4><aclass='secnum'href='#qty.real.cpo'style='min-width:95pt'>5.5.3.2</a><spanclass='texttt'>mp_<spanclass='shy'></span>units​::​real</span><aclass='abbr_ref'href='qty.real.cpo.html'>[qty.real.cpo]</a></h4><divclass='para'id='qty.real.cpo-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.real.cpo-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3801'>#</a></div><divclass='texpara'><divid='qty.real.cpo-1.sentence-1'class='sentence'>The name <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>real</span> denotes a customization point object (<ahref="https://wg21.link/customization.point.object">N4971, [customization.point.object]</a>)<aclass='hidden_link'href='#qty.real.cpo-1.sentence-1'>.</a></div></div></div><divclass='para'id='qty.real.cpo-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.real.cpo-2'>2</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3804'>#</a></div><divclass='texpara'><divid='qty.real.cpo-2.sentence-1'class='sentence'>Given a subexpression <spanclass='texttt'>E</span> with type <spanclass='texttt'>T</span>,
let <spanclass='texttt'>t</span> be an lvalue that denotes the reified object for <spanclass='texttt'>E</span><aclass='hidden_link'href='#qty.real.cpo-2.sentence-1'>.</a></div><divid='qty.real.cpo-2.sentence-2'class='sentence'>Then:
<ulclass='itemize'><liid='qty.real.cpo-2.1'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.real.cpo-2.1'>(2.1)</a></div><divclass='texpara'><divid='qty.real.cpo-2.1.sentence-1'class='sentence'>If <spanclass='texttt'>T</span> does not model <ahref='#concept:WeaklyRegular'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:WeaklyRegular'><spanclass='texttt'><i>WeaklyRegular</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>real<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is ill-formed<aclass='hidden_link'href='#qty.real.cpo-2.1.sentence-1'>.</a></div></div></li><liid='qty.real.cpo-2.2'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.real.cpo-2.2'>(2.2)</a></div><divclass='texpara'><divid='qty.real.cpo-2.2.sentence-1'class='sentence'>If <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>real<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar'><spanclass='texttt'><i>Scalar</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>real<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>real<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#qty.real.cpo-2.2.sentence-1'>.</a></div></div></li><liid='qty.real.cpo-2.3'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.real.cpo-2.3'>(2.3)</a></div><divclass='texpara'><divid='qty.real.cpo-2.3.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'>T</span> is a class or enumeration type and
<spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>real<spanclass='parenthesis'>(</span>t<spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar_'><spanclass='texttt'><i>Scalar</i></span></span></a>
where the meaning of <spanclass='texttt'>real</span> is established as-if by performing argument-dependent lookup only (<ahref="https://wg21.link/basic.lookup.argdep">N4971, [basic.lookup.argdep]</a>),
then <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>real<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to that expression<aclass='hidden_link'href='#qty.real.cpo-2.3.sentence-1'>.</a></div></div></li><liid='qty.real.cpo-2.4'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.real.cpo-2.4'>(2.4)</a></div><divclass='texpara'><divid='qty.real.cpo-2.4.sentence-1'class='sentence'>Otherwise, <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>real<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is ill-formed<aclass='hidden_link'href='#qty.real.cpo-2.4.sentence-1'>.</a></div></div></li></ul></div></div></div></div><divid='qty.imag.cpo'class='section'><h4><aclass='secnum'href='#qty.imag.cpo'style='min-width:95pt'>5.5.3.3</a><spanclass='texttt'>mp_<spanclass='shy'></span>units​::​imag</span><aclass='abbr_ref'href='qty.imag.cpo.html'>[qty.imag.cpo]</a></h4><divclass='para'id='qty.imag.cpo-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.imag.cpo-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3826'>#</a></div><divclass='texpara'><divid='qty.imag.cpo-1.sentence-1'class='sentence'>The name <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>imag</span> denotes a customization point object (<ahref="https://wg21.link/customization.point.object">N4971, [customization.point.object]</a>)<aclass='hidden_link'href='#qty.imag.cpo-1.sentence-1'>.</a></div></div></div><divclass='para'id='qty.imag.cpo-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.imag.cpo-2'>2</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3829'>#</a></div><divclass='texpara'><divid='qty.imag.cpo-2.sentence-1'class='sentence'>Given a subexpression <spanclass='texttt'>E</span> with type <spanclass='texttt'>T</span>,
let <spanclass='texttt'>t</span> be an lvalue that denotes the reified object for <spanclass='texttt'>E</span><aclass='hidden_link'href='#qty.imag.cpo-2.sentence-1'>.</a></div><divid='qty.imag.cpo-2.sentence-2'class='sentence'>Then:
<ulclass='itemize'><liid='qty.imag.cpo-2.1'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.imag.cpo-2.1'>(2.1)</a></div><divclass='texpara'><divid='qty.imag.cpo-2.1.sentence-1'class='sentence'>If <spanclass='texttt'>T</span> does not model <ahref='#concept:WeaklyRegular'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:WeaklyRegular_'><spanclass='texttt'><i>WeaklyRegular</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>imag<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is ill-formed<aclass='hidden_link'href='#qty.imag.cpo-2.1.sentence-1'>.</a></div></div></li><liid='qty.imag.cpo-2.2'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.imag.cpo-2.2'>(2.2)</a></div><divclass='texpara'><divid='qty.imag.cpo-2.2.sentence-1'class='sentence'>If <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>imag<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar__'><spanclass='texttt'><i>Scalar</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>imag<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>imag<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#qty.imag.cpo-2.2.sentence-1'>.</a></div></div></li><liid='qty.imag.cpo-2.3'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.imag.cpo-2.3'>(2.3)</a></div><divclass='texpara'><divid='qty.imag.cpo-2.3.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'>T</span> is a class or enumeration type and
<spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>imag<spanclass='parenthesis'>(</span>t<spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar___'><spanclass='texttt'><i>Scalar</i></span></span></a>
where the meaning of <spanclass='texttt'>imag</span> is established as-if by performing argument-dependent lookup only (<ahref="https://wg21.link/basic.lookup.argdep">N4971, [basic.lookup.argdep]</a>),
then <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>imag<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to that expression<aclass='hidden_link'href='#qty.imag.cpo-2.3.sentence-1'>.</a></div></div></li><liid='qty.imag.cpo-2.4'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.imag.cpo-2.4'>(2.4)</a></div><divclass='texpara'><divid='qty.imag.cpo-2.4.sentence-1'class='sentence'>Otherwise, <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>imag<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is ill-formed<aclass='hidden_link'href='#qty.imag.cpo-2.4.sentence-1'>.</a></div></div></li></ul></div></div></div></div><divid='qty.modulus.cpo'class='section'><h4><aclass='secnum'href='#qty.modulus.cpo'style='min-width:95pt'>5.5.3.4</a><spanclass='texttt'>mp_<spanclass='shy'></span>units​::​modulus</span><aclass='abbr_ref'href='qty.modulus.cpo.html'>[qty.modulus.cpo]</a></h4><divclass='para'id='qty.modulus.cpo-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.modulus.cpo-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3851'>#</a></div><divclass='texpara'><divid='qty.modulus.cpo-1.sentence-1'class='sentence'>The name <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>modulus</span> denotes a customization point object (<ahref="https://wg21.link/customization.point.object">N4971, [customization.point.object]</a>)<aclass='hidden_link'href='#qty.modulus.cpo-1.sentence-1'>.</a></div></div></div><divclass='para'id='qty.modulus.cpo-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.modulus.cpo-2'>2</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3854'>#</a></div><divclass='texpara'><divid='qty.modulus.cpo-2.sentence-1'class='sentence'>Given a subexpression <spanclass='texttt'>E</span> with type <spanclass='texttt'>T</span>,
let <spanclass='texttt'>t</span> be an lvalue that denotes the reified object for <spanclass='texttt'>E</span><aclass='hidden_link'href='#qty.modulus.cpo-2.sentence-1'>.</a></div><divid='qty.modulus.cpo-2.sentence-2'class='sentence'>Then:
<ulclass='itemize'><liid='qty.modulus.cpo-2.1'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.modulus.cpo-2.1'>(2.1)</a></div><divclass='texpara'><divid='qty.modulus.cpo-2.1.sentence-1'class='sentence'>If <spanclass='texttt'>T</span> does not model <ahref='#concept:WeaklyRegular'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:WeaklyRegular__'><spanclass='texttt'><i>WeaklyRegular</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>modulus<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is ill-formed<aclass='hidden_link'href='#qty.modulus.cpo-2.1.sentence-1'>.</a></div></div></li><liid='qty.modulus.cpo-2.2'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.modulus.cpo-2.2'>(2.2)</a></div><divclass='texpara'><divid='qty.modulus.cpo-2.2.sentence-1'class='sentence'>If <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>modulus<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar____'><spanclass='texttt'><i>Scalar</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>modulus<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>modulus<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#qty.modulus.cpo-2.2.sentence-1'>.</a></div></div></li><liid='qty.modulus.cpo-2.3'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.modulus.cpo-2.3'>(2.3)</a></div><divclass='texpara'><divid='qty.modulus.cpo-2.3.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'>T</span> is a class or enumeration type and
<spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>modulus<spanclass='parenthesis'>(</span>t<spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar_____'><spanclass='texttt'><i>Scalar</i></span></span></a>
where the meaning of <spanclass='texttt'>modulus</span> is established as-if by performing argument-dependent lookup only (<ahref="https://wg21.link/basic.lookup.argdep">N4971, [basic.lookup.argdep]</a>),
then <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>modulus<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to that expression<aclass='hidden_link'href='#qty.modulus.cpo-2.3.sentence-1'>.</a></div></div></li><liid='qty.modulus.cpo-2.4'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.modulus.cpo-2.4'>(2.4)</a></div><divclass='texpara'><divid='qty.modulus.cpo-2.4.sentence-1'class='sentence'>If <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>abs<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar______'><spanclass='texttt'><i>Scalar</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>modulus<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>abs<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#qty.modulus.cpo-2.4.sentence-1'>.</a></div></div></li><liid='qty.modulus.cpo-2.5'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.modulus.cpo-2.5'>(2.5)</a></div><divclass='texpara'><divid='qty.modulus.cpo-2.5.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'>T</span> is a class or enumeration type and
<spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>abs<spanclass='parenthesis'>(</span>t<spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar_______'><spanclass='texttt'><i>Scalar</i></span></span></a>
where the meaning of <spanclass='texttt'>abs</span> is established as-if by performing argument-dependent lookup only (<ahref="https://wg21.link/basic.lookup.argdep">N4971, [basic.lookup.argdep]</a>),
then <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>modulus<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to that expression<aclass='hidden_link'href='#qty.modulus.cpo-2.5.sentence-1'>.</a></div></div></li><liid='qty.modulus.cpo-2.6'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.modulus.cpo-2.6'>(2.6)</a></div><divclass='texpara'><divid='qty.modulus.cpo-2.6.sentence-1'class='sentence'>Otherwise, <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>modulus<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is ill-formed<aclass='hidden_link'href='#qty.modulus.cpo-2.6.sentence-1'>.</a></div></div></li></ul></div></div></div></div><divid='qty.mag.cpo'class='section'><h4><aclass='secnum'href='#qty.mag.cpo'style='min-width:95pt'>5.5.3.5</a><spanclass='texttt'>mp_<spanclass='shy'></span>units​::​magnitude</span><aclass='abbr_ref'href='qty.mag.cpo.html'>[qty.mag.cpo]</a></h4><divclass='para'id='qty.mag.cpo-1'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.mag.cpo-1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3884'>#</a></div><divclass='texpara'><divid='qty.mag.cpo-1.sentence-1'class='sentence'>The name <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>magnitude</span> denotes a customization point object (<ahref="https://wg21.link/customization.point.object">N4971, [customization.point.object]</a>)<aclass='hidden_link'href='#qty.mag.cpo-1.sentence-1'>.</a></div></div></div><divclass='para'id='qty.mag.cpo-2'><divclass='marginalizedparent'><aclass='marginalized'href='#qty.mag.cpo-2'>2</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3887'>#</a></div><divclass='texpara'><divid='qty.mag.cpo-2.sentence-1'class='sentence'>Given a subexpression <spanclass='texttt'>E</span> with type <spanclass='texttt'>T</span>,
let <spanclass='texttt'>t</span> be an lvalue that denotes the reified object for <spanclass='texttt'>E</span><aclass='hidden_link'href='#qty.mag.cpo-2.sentence-1'>.</a></div><divid='qty.mag.cpo-2.sentence-2'class='sentence'>Then:
<ulclass='itemize'><liid='qty.mag.cpo-2.1'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.mag.cpo-2.1'>(2.1)</a></div><divclass='texpara'><divid='qty.mag.cpo-2.1.sentence-1'class='sentence'>If <spanclass='texttt'>T</span> does not model <ahref='#concept:WeaklyRegular'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:WeaklyRegular___'><spanclass='texttt'><i>WeaklyRegular</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>magnitude<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is ill-formed<aclass='hidden_link'href='#qty.mag.cpo-2.1.sentence-1'>.</a></div></div></li><liid='qty.mag.cpo-2.2'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.mag.cpo-2.2'>(2.2)</a></div><divclass='texpara'><divid='qty.mag.cpo-2.2.sentence-1'class='sentence'>If <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>magnitude<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar________'><spanclass='texttt'><i>Scalar</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>magnitude<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>magnitude<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#qty.mag.cpo-2.2.sentence-1'>.</a></div></div></li><liid='qty.mag.cpo-2.3'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.mag.cpo-2.3'>(2.3)</a></div><divclass='texpara'><divid='qty.mag.cpo-2.3.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'>T</span> is a class or enumeration type and
<spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>magnitude<spanclass='parenthesis'>(</span>t<spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar_________'><spanclass='texttt'><i>Scalar</i></span></span></a>
where the meaning of <spanclass='texttt'>magnitude</span> is established as-if by performing argument-dependent lookup only (<ahref="https://wg21.link/basic.lookup.argdep">N4971, [basic.lookup.argdep]</a>),
then <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>magnitude<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to that expression<aclass='hidden_link'href='#qty.mag.cpo-2.3.sentence-1'>.</a></div></div></li><liid='qty.mag.cpo-2.4'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.mag.cpo-2.4'>(2.4)</a></div><divclass='texpara'><divid='qty.mag.cpo-2.4.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>abs<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar__________'><spanclass='texttt'><i>Scalar</i></span></span></a>,
<spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>magnitude<spanclass='parenthesis'>(</span>​E<spanclass='parenthesis'>)</span></span> is expression-equivalent to <spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>t<spanclass='operator'>.</span>abs<spanclass='parenthesis'>(</span><spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span><aclass='hidden_link'href='#qty.mag.cpo-2.4.sentence-1'>.</a></div></div></li><liid='qty.mag.cpo-2.5'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.mag.cpo-2.5'>(2.5)</a></div><divclass='texpara'><divid='qty.mag.cpo-2.5.sentence-1'class='sentence'>Otherwise, if <spanclass='texttt'>T</span> is a class or enumeration type and
<spanclass='texttt'><spanclass='keyword'>auto</span><spanclass='parenthesis'>(</span>abs<spanclass='parenthesis'>(</span>t<spanclass='parenthesis'>)</span><spanclass='parenthesis'>)</span></span> is a valid expression whose type models <ahref='#concept:Scalar'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Scalar___________'><spanclass='texttt'><i>Scalar</i></span></span></a>
where the meaning of <spanclass='texttt'>magnitude</span> is established as-if by performing argument-dependent lookup only (<ahref="https://wg21.link/basic.lookup.argdep">N4971, [basic.lookup.argdep]</a>),
then <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>magnitude<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is expression-equivalent to that expression<aclass='hidden_link'href='#qty.mag.cpo-2.5.sentence-1'>.</a></div></div></li><liid='qty.mag.cpo-2.6'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#qty.mag.cpo-2.6'>(2.6)</a></div><divclass='texpara'><divid='qty.mag.cpo-2.6.sentence-1'class='sentence'>Otherwise, <spanclass='texttt'>mp_<spanclass='shy'></span>units<spanclass='operator'>​::​</span>magnitude<spanclass='parenthesis'>(</span>E<spanclass='parenthesis'>)</span></span> is ill-formed<aclass='hidden_link'href='#qty.mag.cpo-2.6.sentence-1'>.</a></div></div></li></ul></div></div></div></div></div><divid='concepts'class='section'><h3><aclass='secnum'href='#concepts'style='min-width:80pt'>5.5.4</a> Concepts <aclass='abbr_ref'href='qty.rep.concepts.html'>[qty.rep.concepts]</a></h3><divclass='texpara'><divclass='itemdecl'id='concepts-itemdecl:1'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#concepts-itemdecl:1'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> T<spanclass='anglebracket'>></span>
<spanclass='keyword'>concept</span><spanclass='texttt'><i>Scalar</i></span><aclass='index'id='concept:Scalar'></a><spanclass='operator'>=</span><spanclass='parenthesis'>(</span><spanclass='operator'>!</span>disable_scalar<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span><spanclass='parenthesis'>)</span><spanclass='operator'>&</span><spanclass='operator'>&</span><aclass='index'id='conceptref:WeaklyRegular____'></a><spanclass='texttt'><i>WeaklyRegular</i></span><spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span><spanclass='operator'>&</span><spanclass='operator'>&</span><spanclass='keyword'>requires</span><spanclass='parenthesis'>(</span>T a, T b<spanclass='parenthesis'>)</span><spanclass='curlybracket'>{</span><spanclass='comment'>// <i>exposition only</i></span>
<spanclass='curlybracket'>{</span> a <spanclass='operator'>+</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>-</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>*</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>/</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='keyword'>requires</span><spanclass='parenthesis'>(</span>T a, T b, <spanclass='texttt'><i>value-type-t</i></span><spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span> s<spanclass='parenthesis'>)</span><spanclass='curlybracket'>{</span>
<spanclass='curlybracket'>{</span> a <spanclass='operator'>+</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>-</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>*</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>/</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>*</span> s <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> s <spanclass='operator'>*</span> a <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>/</span> s <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='keyword'>requires</span><spanclass='parenthesis'>(</span>T a, T b, <spanclass='texttt'><i>value-type-t</i></span><spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span> s<spanclass='parenthesis'>)</span><spanclass='curlybracket'>{</span>
<spanclass='curlybracket'>{</span> a <spanclass='operator'>+</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>-</span> b <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>*</span> s <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> s <spanclass='operator'>*</span> a <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>/</span> s <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='keyword'>requires</span><spanclass='parenthesis'>(</span>T a, T b, <spanclass='texttt'><i>scaling-factor-type-t</i></span><spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span> f<spanclass='parenthesis'>)</span><spanclass='curlybracket'>{</span>
<spanclass='comment'>// scaling</span>
<spanclass='curlybracket'>{</span> a <spanclass='operator'>*</span> f <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> f <spanclass='operator'>*</span> a <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>/</span> f <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='keyword'>requires</span><spanclass='parenthesis'>(</span>T a, T b, <spanclass='texttt'><i>scaling-factor-type-t</i></span><spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span> f<spanclass='parenthesis'>)</span><spanclass='curlybracket'>{</span>
<spanclass='comment'>// scaling</span>
<spanclass='curlybracket'>{</span> a <spanclass='operator'>*</span> T<spanclass='parenthesis'>(</span>f<spanclass='parenthesis'>)</span><spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> T<spanclass='parenthesis'>(</span>f<spanclass='parenthesis'>)</span><spanclass='operator'>*</span> a <spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
<spanclass='curlybracket'>{</span> a <spanclass='operator'>/</span> T<spanclass='parenthesis'>(</span>f<spanclass='parenthesis'>)</span><spanclass='curlybracket'>}</span><spanclass='operator'>-</span><spanclass='anglebracket'>></span> std<spanclass='operator'>::</span>common_with<spanclass='anglebracket'><</span>T<spanclass='anglebracket'>></span>;
</code></div></div><divclass='para'id='concepts-7'><divclass='marginalizedparent'><aclass='marginalized'href='#concepts-7'>7</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L4030'>#</a></div><divclass='texpara'><divid='concepts-7.sentence-1'class='sentence'>A type <spanclass='texttt'>T</span> models <ahref='#concept:Representation'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Representation'><spanclass='texttt'>Representation</span></span></a> if
it represents the numerical value of a quantity (<ahref="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-29">IEC 60050, 112-01-29</a>)<aclass='hidden_link'href='#concepts-7.sentence-1'>.</a></div></div></div><divclass='texpara'><divclass='itemdecl'id='concepts-itemdecl:8'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#concepts-itemdecl:8'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span><spanclass='keyword'>typename</span> T, quantity_character Ch<spanclass='anglebracket'>></span>
</code></div></div><divclass='para'id='concepts-8'><divclass='marginalizedparent'><aclass='marginalized'href='#concepts-8'>8</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L4047'>#</a></div><divclass='texpara'><divid='concepts-8.sentence-1'class='sentence'>A type <spanclass='texttt'>T</span> models <spanclass='texttt'><ahref='#concept:RepresentationOf'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:RepresentationOf'><spanclass='texttt'>RepresentationOf</span></span></a><spanclass='anglebracket'><</span>V<spanclass='anglebracket'>></span></span> if
<spanclass='texttt'>T</span> models <ahref='#concept:Representation'title='5.5.4 Concepts [qty.rep.concepts]'><spanid='conceptref:Representation__'><spanclass='texttt'>Representation</span></span></a> and
<ulclass='itemize'><liid='concepts-8.1'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#concepts-8.1'>(8.1)</a></div><spanclass='texttt'>V</span> is a kind of quantity, or</li><liid='concepts-8.2'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#concepts-8.2'>(8.2)</a></div>if <spanclass='texttt'>V</span> is a quantity, then <spanclass='texttt'>T</span> represents a value of its character, or</li><liid='concepts-8.3'><divclass='marginalizedparent'style='left:-27mm'><aclass='marginalized'href='#concepts-8.3'>(8.3)</a></div>if <spanclass='texttt'>V</span> is a quantity character, then <spanclass='texttt'>T</span> represents a value of <spanclass='texttt'>V</span><aclass='hidden_link'href='#concepts-8.sentence-1'>.</a></li></ul></div></div></div></div></div></body></html>