-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed 6d93f73 to HEAD with MkDocs 1.6.1 and mike 2.1.3
- Loading branch information
github-actions
committed
Dec 8, 2024
1 parent
50c4374
commit c362a53
Showing
162 changed files
with
15,622 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html><html lang='en'><head><title>[assoc.qty]</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#assoc.qty'>[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#assoc.qty'>[qty.unit]</a></h3><h4 ><a class='secnum' style='min-width:95pt'>5.4.4.9</a> Associated quantity <a class='abbr_ref'>[assoc.qty]</a></h4><div class='texpara'><div id='lib:has-associated-quantity,Unit'><div id='lib:Unit,has-associated-quantity'><div class='itemdecl'><div class='marginalizedparent'><a class='itemDeclLink' href='#lib:Unit,has-associated-quantity'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'><</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> U<span class='anglebracket'>></span> | ||
<span class='keyword'>consteval</span> <span class='keyword'>bool</span> <span class='texttt'><i >has-associated-quantity</i></span><span class='parenthesis'>(</span>U<span class='parenthesis'>)</span>; <span class='comment'>// <i >exposition only</i></span> | ||
</code></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-units6d93f7385a1c97b02a9f90ffda809bb2f1bbdc19/source/quantities.tex#L3237'>#</a></div><div class='texpara'><div id='1.sentence-1' class='sentence'><i >Returns</i>: <ul class='itemize'><li id='1.1'><div class='marginalizedparent' style='left:-39mm'><a class='marginalized' href='#1.1'>(1.1)</a></div><div class='texpara'><div id='1.1.sentence-1' class='sentence'>If <span class='texttt'>U<span class='operator'>​::​</span><span class='texttt'><i >quantity-spec</i></span></span> is a valid expression, | ||
returns <span class='texttt'><span class='literal'>true</span></span><a class='hidden_link' href='#1.1.sentence-1'>.</a></div></div></li><li id='1.2'><div class='marginalizedparent' style='left:-39mm'><a class='marginalized' href='#1.2'>(1.2)</a></div><div class='texpara'><div id='1.2.sentence-1' class='sentence'>Otherwise, if <span class='texttt'>U<span class='operator'>​::​</span><span class='texttt'><i >reference-unit</i></span></span> is a valid expression, | ||
returns | ||
<span class='codeblock'><i >has-associated-quantity</i><span class='parenthesis'>(</span>U<span class='operator'>::</span><i >reference-unit</i><span class='parenthesis'>)</span> | ||
</span></div></div></li><li id='1.3'><div class='marginalizedparent' style='left:-39mm'><a class='marginalized' href='#1.3'>(1.3)</a></div><div class='texpara'><div id='1.3.sentence-1' class='sentence'>Otherwise, if | ||
<span class='texttt'><span class='texttt'><i >is-derived-from-specialization-of</i></span><span class='anglebracket'><</span>U, <span class='texttt'><i >expr-fractions</i></span><span class='anglebracket'>></span><span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> | ||
is <span class='texttt'><span class='literal'>true</span></span>, | ||
let <span class='texttt'>Nums</span> and <span class='texttt'>Dens</span> | ||
be packs denoting the template arguments of | ||
<span class='texttt'>U<span class='operator'>​::​</span><span class='texttt'><i >nums</i></span></span> and <span class='texttt'>U<span class='operator'>​::​</span><span class='texttt'><i >dens</i></span></span>, respectively<a class='hidden_link' href='#1.3.sentence-1'>.</a></div> <div id='1.3.sentence-2' class='sentence'>Returns | ||
<span class='codeblock'><span class='parenthesis'>(</span><span class='operator'>.</span><span class='operator'>.</span><span class='operator'>.</span> <span class='operator'>&</span><span class='operator'>&</span> <i >has-associated-quantity</i><span class='parenthesis'>(</span><i >expr-type</i><span class='anglebracket'><</span>Nums<span class='anglebracket'>></span><span class='curlybracket'>{</span><span class='curlybracket'>}</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span> <span class='operator'>&</span><span class='operator'>&</span> | ||
<span class='parenthesis'>(</span><span class='operator'>.</span><span class='operator'>.</span><span class='operator'>.</span> <span class='operator'>&</span><span class='operator'>&</span> <i >has-associated-quantity</i><span class='parenthesis'>(</span><i >expr-type</i><span class='anglebracket'><</span>Dens<span class='anglebracket'>></span><span class='curlybracket'>{</span><span class='curlybracket'>}</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span> | ||
</span></div></div></li><li id='1.4'><div class='marginalizedparent' style='left:-39mm'><a class='marginalized' href='#1.4'>(1.4)</a></div><div class='texpara'><div id='1.4.sentence-1' class='sentence'>Otherwise, returns <span class='texttt'><span class='literal'>false</span></span><a class='hidden_link' href='#1.4.sentence-1'>.</a></div></div></li></ul></div></div></div></div><div class='texpara'><div id='lib:get-associated-quantity,AssociatedUnit'><div id='lib:AssociatedUnit,get-associated-quantity'><div class='itemdecl'><div class='marginalizedparent'><a class='itemDeclLink' href='#lib:AssociatedUnit,get-associated-quantity'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'><</span><a href='qty.unit.concepts.html#concept:AssociatedUnit' title='5.4.4.4 Concepts [qty.unit.concepts]'><span id='conceptref:AssociatedUnit'><span class='texttt'>AssociatedUnit</span></span></a> U<span class='anglebracket'>></span> | ||
<span class='keyword'>consteval</span> <span class='keyword'>auto</span> <span class='texttt'><i >get-associated-quantity</i></span><span class='parenthesis'>(</span>U 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-units6d93f7385a1c97b02a9f90ffda809bb2f1bbdc19/source/quantities.tex#L3273'>#</a></div><div class='texpara'><div id='2.sentence-1' class='sentence'><i >Returns</i>: <ul class='itemize'><li id='2.1'><div class='marginalizedparent' style='left:-39mm'><a class='marginalized' href='#2.1'>(2.1)</a></div>If <span class='texttt'>U</span> is of the form <span class='texttt'>common_<span class='shy'></span>unit<span class='anglebracket'><</span>Us<span class='operator'>.</span><span class='operator'>.</span><span class='operator'>.</span><span class='anglebracket'>></span></span>, | ||
returns | ||
<span class='codeblock'>get_common_quantity_spec<span class='parenthesis'>(</span><i >get-associated-quantity</i><span class='parenthesis'>(</span>Us<span class='curlybracket'>{</span><span class='curlybracket'>}</span><span class='parenthesis'>)</span><span class='operator'>.</span><span class='operator'>.</span><span class='operator'>.</span><span class='parenthesis'>)</span> | ||
</span></li><li id='2.2'><div class='marginalizedparent' style='left:-39mm'><a class='marginalized' href='#2.2'>(2.2)</a></div>Otherwise, if <span class='texttt'>U<span class='operator'>​::​</span><span class='texttt'><i >quantity-spec</i></span></span> is a valid expression, | ||
returns | ||
<span class='codeblock'><i >remove-kind</i><span class='parenthesis'>(</span>U<span class='operator'>::</span><i >quantity-spec</i><span class='parenthesis'>)</span> | ||
</span></li><li id='2.3'><div class='marginalizedparent' style='left:-39mm'><a class='marginalized' href='#2.3'>(2.3)</a></div>Otherwise, if <span class='texttt'>U<span class='operator'>​::​</span><span class='texttt'><i >reference-unit</i></span></span> is a valid expression, | ||
returns | ||
<span class='codeblock'><i >get-associated-quantity</i><span class='parenthesis'>(</span>U<span class='operator'>::</span><i >reference-unit</i><span class='parenthesis'>)</span> | ||
</span></li><li id='2.4'><div class='marginalizedparent' style='left:-39mm'><a class='marginalized' href='#2.4'>(2.4)</a></div>Otherwise, if | ||
<span class='texttt'><span class='texttt'><i >is-derived-from-specialization-of</i></span><span class='anglebracket'><</span>U, <span class='texttt'><i >expr-fractions</i></span><span class='anglebracket'>></span><span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> | ||
is <span class='texttt'><span class='literal'>true</span></span>, | ||
returns | ||
<span class='codeblock'><i >expr-map</i><span class='anglebracket'><</span><i >to-quantity-spec</i>, derived_quantity_spec, <span class='keyword'>struct</span> dimensionless<span class='anglebracket'>></span><span class='parenthesis'>(</span>u<span class='parenthesis'>)</span> | ||
</span> | ||
where <span class='texttt'><i >to-quantity-spec</i></span> is defined as follows: | ||
<span class='codeblock'><span class='keyword'>template</span><span class='anglebracket'><</span><a href='qty.unit.concepts.html#concept:AssociatedUnit' title='5.4.4.4 Concepts [qty.unit.concepts]'><span id='conceptref:AssociatedUnit_'><span class='tcode_in_codeblock'>AssociatedUnit</span></span></a> U<span class='anglebracket'>></span> | ||
<span class='keyword'>using</span> <i >to-quantity-spec</i> <span class='operator'>=</span> <span class='keyword'>decltype</span><span class='parenthesis'>(</span><i >get-associated-quantity</i><span class='parenthesis'>(</span>U<span class='curlybracket'>{</span><span class='curlybracket'>}</span><span class='parenthesis'>)</span><span class='parenthesis'>)</span>; <span class='comment'>// <i >exposition only</i></span> | ||
</span></li></ul></div></div></div></div></div></body></html> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.