forked from mpusz/mp-units
11 lines
5.2 KiB
HTML
11 lines
5.2 KiB
HTML
<!DOCTYPE html><html lang='en'><head><title>[qty.canon.unit]</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.canon.unit'>[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#qty.canon.unit'>[qty.unit]</a></h3><h4 ><a class='secnum' style='min-width:95pt'>5.4.4.5</a> Types <a class='abbr_ref' href='qty.unit.types.html#qty.canon.unit'>[qty.unit.types]</a></h4><h4 ><a class='secnum' style='min-width:110pt'>5.4.4.5.1</a> Canonical <a class='abbr_ref'>[qty.canon.unit]</a></h4><div class='texpara'><span id='lib:canonical-unit'><div class='marginalizedparent'><a class='itemDeclLink' href='#lib:canonical-unit'>🔗</a></div><span class='codeblock'><span class='keyword'>namespace</span> mp_units <span class='curlybracket'>{</span>
|
|
|
|
<span class='keyword'>template</span><span class='anglebracket'><</span><a href='qty.unit.mag.concepts.html#concept:UnitMagnitude' title='5.4.4.2.2 Concepts [qty.unit.mag.concepts]'><span id='conceptref:UnitMagnitude'><span class='tcode_in_codeblock'>UnitMagnitude</span></span></a> M, <a href='qty.unit.concepts.html#concept:Unit' title='5.4.4.4 Concepts [qty.unit.concepts]'><span id='conceptref:Unit'><span class='tcode_in_codeblock'>Unit</span></span></a> U<span class='anglebracket'>></span>
|
|
<span class='keyword'>struct</span> <i >canonical-unit</i> <span class='curlybracket'>{</span> <span class='comment'>// <i >exposition only</i></span>
|
|
M mag;
|
|
U reference_unit;
|
|
<span class='curlybracket'>}</span>;
|
|
|
|
<span class='curlybracket'>}</span>
|
|
</span></span></div><div class='para' id='1'><div class='marginalizedparent'><a class='marginalized' href='#1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2597'>#</a></div><div class='texpara'><div id='1.sentence-1' class='sentence'><span class='texttt'><i >canonical-unit</i></span> represents a unit expressed in terms of base units (<a href="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=112-01-18">IEC 60050, 112-01-18</a>)<a class='hidden_link' href='#1.sentence-1'>.</a></div> <div id='note-1' class='note'><div class='texpara'>[<i>Note <a href='#note-1'>1</a></i>: <div id='1.sentence-2' class='sentence'>Other types representing units are equal only if they have the same type<a class='hidden_link' href='#1.sentence-2'>.</a></div> <div id='1.sentence-3' class='sentence'><span class='texttt'><i >canonical-unit</i></span> is used to implement binary relations other than equality<a class='hidden_link' href='#1.sentence-3'>.</a></div> — <i>end note</i>]</div></div> <div id='1.sentence-4' class='sentence'><span class='texttt'>reference_<span class='shy'></span>unit</span> is simplified (<a href='qty.sym.expr.algos.html' title='5.3.4.4 Algorithms'>[qty.<span class='shy'></span>sym.<span class='shy'></span>expr.<span class='shy'></span>algos]</a>)<a class='hidden_link' href='#1.sentence-4'>.</a></div></div></div><div class='texpara'><div id='lib:get-canonical-unit,Unit'><div id='lib:Unit,get-canonical-unit'><div class='itemdecl'><div class='marginalizedparent'><a class='itemDeclLink' href='#lib:Unit,get-canonical-unit'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>consteval</span> <span class='keyword'>auto</span> <span class='texttt'><i >get-canonical-unit</i></span><span class='parenthesis'>(</span><a href='qty.unit.concepts.html#concept:Unit' title='5.4.4.4 Concepts [qty.unit.concepts]'><span id='conceptref:Unit_'><span class='texttt'>Unit</span></span></a> <span class='keyword'>auto</span> u<span class='parenthesis'>)</span>; <span class='comment'>// <i >exposition only</i></span>
|
|
</code></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#L2611'>#</a></div><div class='texpara'><div id='2.sentence-1' class='sentence'><i >Returns</i>: The instantiation of <span class='texttt'><i >canonical-unit</i></span> for <span class='texttt'>u</span><a class='hidden_link' href='#2.sentence-1'>.</a></div></div></div></div></div></body></html> |