forked from mpusz/mp-units
12 lines
5.2 KiB
HTML
12 lines
5.2 KiB
HTML
<!DOCTYPE html><html lang='en'><head><title>[qty.char.traits]</title><meta charset='UTF-8'/><link rel='stylesheet' type='text/css' href='14882.css'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Serif'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Sans'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Sans+Mono'/><link rel='icon' href='icon.png'/><link rel='stylesheet' type='text/css' href='expanded.css' title='Normal'/><link rel='alternate stylesheet' type='text/css' href='colored.css' title='Notes and examples colored'/><link rel='alternate stylesheet' type='text/css' href='normative-only.css' title='Notes and examples hidden'/></head><body><div class='wrapper'><h1 ><a class='secnum' style='min-width:50pt'>5</a> Quantities and units library <a class='abbr_ref' href='index.html#quantities'>[quantities]</a></h1><h2 ><a class='secnum' style='min-width:65pt'>5.5</a> Representation <a class='abbr_ref' href='qty.rep.html#qty.char.traits'>[qty.rep]</a></h2><h3 ><a class='secnum' style='min-width:80pt'>5.5.2</a> Traits <a class='abbr_ref' href='qty.rep.traits.html#qty.char.traits'>[qty.rep.traits]</a></h3><h4 ><a class='secnum' style='min-width:95pt'>5.5.2.2</a> Quantity character <a class='abbr_ref'>[qty.char.traits]</a></h4><div class='texpara'><div id='lib:disable_vector'><div id='lib:disable_complex'><div id='lib:disable_scalar'><div class='itemdecl'><div class='marginalizedparent'><a class='itemDeclLink' href='#lib:disable_scalar'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'><</span><span class='keyword'>typename</span> T<span class='anglebracket'>></span>
|
|
<span class='keyword'>constexpr</span> <span class='keyword'>bool</span> disable_scalar <span class='operator'>=</span> <span class='literal'>false</span>;
|
|
<span class='keyword'>template</span><span class='anglebracket'><</span><span class='keyword'>typename</span> T<span class='anglebracket'>></span>
|
|
<span class='keyword'>constexpr</span> <span class='keyword'>bool</span> disable_complex <span class='operator'>=</span> <span class='literal'>false</span>;
|
|
<span class='keyword'>template</span><span class='anglebracket'><</span><span class='keyword'>typename</span> T<span class='anglebracket'>></span>
|
|
<span class='keyword'>constexpr</span> <span class='keyword'>bool</span> disable_vector <span class='operator'>=</span> <span class='literal'>false</span>;
|
|
</code></div></div></div></div></div><div class='para' id='1'><div class='marginalizedparent'><a class='marginalized' href='#1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3736'>#</a></div><div class='texpara'><div id='1.sentence-1' class='sentence'>Some quantities are defined as having a numerical value (<a href="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-29">IEC 60050, 112-01-29</a>) of a specific set (<a href="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=102-01-02">IEC 60050, 102-01-02</a>)<a class='hidden_link' href='#1.sentence-1'>.</a></div> <div id='1.sentence-2' class='sentence'>The representation concepts use these traits
|
|
to help determine the sets <span class='texttt'>T</span> represents<a class='hidden_link' href='#1.sentence-2'>.</a></div></div></div></div><div class='para' id='2'><div class='marginalizedparent'><a class='marginalized' href='#2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3741'>#</a></div><div class='texpara'><div id='2.sentence-1' class='sentence'><i >Remarks</i>: Pursuant to <a href="https://wg21.link/namespace.std">N4971, [namespace.std]</a> (<a href='spec.ext.html' title='4.1 External'>[spec.<span class='shy'></span>ext]</a>),
|
|
users may specialize these templates
|
|
for cv-unqualified program-defined types<a class='hidden_link' href='#2.sentence-1'>.</a></div> <div id='2.sentence-2' class='sentence'>Such specializations shall be usable in constant expressions (<a href="https://wg21.link/expr.const">N4971, [expr.const]</a>)
|
|
and have type <span class='texttt'><span class='keyword'>const</span> <span class='keyword'>bool</span></span><a class='hidden_link' href='#2.sentence-2'>.</a></div></div></div></div><div class='para nonNormativeOnly' id='3'><div class='marginalizedparent'><a class='marginalized' href='#3'>3</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L3749'>#</a></div><div class='texpara'><div id='note-1' class='note'><div class='texpara'>[<i>Note <a href='#note-1'>1</a></i>: <div id='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<a class='hidden_link' href='#3.sentence-1'>.</a></div> — <i>end note</i>]</div></div></div></div></div></div></body></html> |