Files
mp-units/HEAD/api_reference/gen/qty.sym.expr.general.html
T

9 lines
3.7 KiB
HTML

<!DOCTYPE html><html lang='en'><head><title>[qty.sym.expr.general]</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.3</a> Utilities <a class='abbr_ref' href='qty.utils.html#qty.sym.expr.general'>[qty.utils]</a></h2><h3 ><a class='secnum' style='min-width:80pt'>5.3.4</a> Symbolic expressions <a class='abbr_ref' href='qty.sym.expr.html#general'>[qty.sym.expr]</a></h3><h4 ><a class='secnum' style='min-width:95pt'>5.3.4.1</a> General <a class='abbr_ref'>[qty.sym.expr.general]</a></h4><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-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L981'>#</a></div><div class='texpara'><div id='1.sentence-1' class='sentence'>Subclause <a href='qty.sym.expr.html' title='5.3.4&emsp;Symbolic expressions'>[qty.<span class='shy'></span>sym.<span class='shy'></span>expr]</a> specifies the components
used to maintain ordered, simplified, and readable
argument lists in the names of specializations<a class='hidden_link' href='#1.sentence-1'>.</a></div> <div id='example-1' class='example'><div class='texpara'>[<i>Example&nbsp;<a href='#example-1'>1</a></i>:&ensp;<span class='codeblock'><span class='keyword'>using</span> <span class='keyword'>namespace</span> si<span class='operator'>::</span>unit_symbols;
<span class='keyword'>int</span> x <span class='operator'>=</span> kg <span class='operator'>*</span> km <span class='operator'>/</span> square<span class='parenthesis'>(</span>h<span class='parenthesis'>)</span>; <span class='comment'>// error: cannot construct from</span>
<span class='comment'>// <span class='tcode_in_codeblock'>derived_<span class='shy'></span>unit&lt;si&#x200b;::&#x200b;kilo_<span class='shy'></span>&lt;si&#x200b;::&#x200b;gram&gt;, si&#x200b;::&#x200b;kilo_<span class='shy'></span>&lt;si&#x200b;::&#x200b;metre&gt;, per&lt;power&lt;non_<span class='shy'></span>si&#x200b;::&#x200b;hour, 2&gt;&gt;&gt;</span></span>
</span> <div id='1.sentence-2' class='sentence'>
The library ensures <span class='texttt'><span class='keyword'>decltype</span><span class='parenthesis'>(</span>kg <span class='operator'>*</span> km <span class='operator'>/</span> square<span class='parenthesis'>(</span>h<span class='parenthesis'>)</span><span class='parenthesis'>)</span></span> is styled-like as commented in diagnostics,
provided that, in the implementation-defined total order of types,
<span class='texttt'><span class='keyword'>decltype</span><span class='parenthesis'>(</span>kg<span class='parenthesis'>)</span></span> is less than <span class='texttt'><span class='keyword'>decltype</span><span class='parenthesis'>(</span>km<span class='parenthesis'>)</span></span><a class='hidden_link' href='#1.sentence-2'>.</a></div>&nbsp;<i>end example</i>]</div></div></div></div></div></body></html>