<!DOCTYPE html><htmllang='en'><head><title>[qty.fp.traits]</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'href='qty.rep.html#qty.fp.traits'>[qty.rep]</a></h2><h3><aclass='secnum'style='min-width:80pt'>5.5.2</a> Traits <aclass='abbr_ref'href='qty.rep.traits.html#qty.fp.traits'>[qty.rep.traits]</a></h3><h4><aclass='secnum'style='min-width:95pt'>5.5.2.1</a> Floating-point <aclass='abbr_ref'>[qty.fp.traits]</a></h4><divclass='texpara'><divclass='itemdecl'id='itemdecl:1'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#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='1'><divclass='marginalizedparent'><aclass='marginalized'href='#1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitsf5f502e76f0206565e7dd0453b25e6f87a45a412/source/quantities.tex#L3708'>#</a></div><divclass='texpara'><divid='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='#1.sentence-1'>.</a></div></div></div></div><divclass='para'id='2'><divclass='marginalizedparent'><aclass='marginalized'href='#2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitsf5f502e76f0206565e7dd0453b25e6f87a45a412/source/quantities.tex#L3712'>#</a></div><divclass='texpara'><divid='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='#2.sentence-1'>.</a></div><divid='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='#2.sentence-2'>.</a></div></div></div></div></div></body></html>