Files
mp-units/HEAD/api_reference/gen/qty.unit.traits.html
T

8 lines
4.0 KiB
HTML

<!DOCTYPE html><html lang='en'><head><title>[qty.unit.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.4</a> Reference <a class='abbr_ref' href='qty.ref.html#qty.unit.traits'>[qty.ref]</a></h2><h3 ><a class='secnum' style='min-width:80pt'>5.4.4</a> Unit <a class='abbr_ref' href='qty.unit.html#traits'>[qty.unit]</a></h3><h4 ><a class='secnum' style='min-width:95pt'>5.4.4.3</a> Traits <a class='abbr_ref'>[qty.unit.traits]</a></h4><div class='texpara'><div id='lib:space_before_unit_symbol'><div class='itemdecl'><div class='marginalizedparent'><a class='itemDeclLink' href='#lib:space_before_unit_symbol'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><a href='qty.unit.concepts.html#concept:Unit' title='5.4.4.4&emsp;Concepts&emsp;[qty.unit.concepts]'><span id='conceptref:Unit'><span class='texttt'>Unit</span></span></a> <span class='keyword'>auto</span> U<span class='anglebracket'>&gt;</span>
<span class='keyword'>constexpr</span> <span class='keyword'>bool</span> space_before_unit_symbol <span class='operator'>=</span> <span class='literal'>true</span>;
</code></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#L2528'>#</a></div><div class='texpara'><div id='1.sentence-1' class='sentence'>The formatting functions (<a href='qty.unit.sym.fmt.html' title='5.4.4.10&emsp;Symbol formatting'>[qty.<span class='shy'></span>unit.<span class='shy'></span>sym.<span class='shy'></span>fmt]</a>) use <span class='texttt'>space_<span class='shy'></span>before_<span class='shy'></span>unit_<span class='shy'></span>symbol</span>
to determine whether there is a space
between the numerical value and the unit symbol<a class='hidden_link' href='#1.sentence-1'>.</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#L2533'>#</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&emsp;External'>[spec.<span class='shy'></span>ext]</a>),
users may specialize <span class='texttt'>space_<span class='shy'></span>before_<span class='shy'></span>unit_<span class='shy'></span>symbol</span>
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></body></html>