Files
mp-units/HEAD/api_reference/gen/qty.pt.assign.ops.html
T

11 lines
6.6 KiB
HTML

<!DOCTYPE html><html lang='en'><head><title>[qty.pt.assign.ops]</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.7</a> Quantity point <a class='abbr_ref' href='qty.pt.html#assign.ops'>[qty.pt]</a></h2><h3 ><a class='secnum' style='min-width:80pt'>5.7.11</a> Compound assignment operations <a class='abbr_ref'>[qty.pt.assign.ops]</a></h3><div class='texpara'><div id='lib:quantity,operator-='><div id='lib:operator-=,quantity'><div id='lib:quantity_point,operator-='><div id='lib:operator-=,quantity_point'><div id='lib:quantity,operator+='><div id='lib:operator+=,quantity'><div id='lib:quantity_point,operator+='><div id='lib:operator+=,quantity_point'><div class='itemdecl'><div class='marginalizedparent'><a class='itemDeclLink' href='#lib:operator+=,quantity_point'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'>&lt;</span><a class='index' id='conceptref:Mutable'></a><span class='texttt'><i >Mutable</i></span><span class='anglebracket'>&lt;</span>quantity_point<span class='anglebracket'>&gt;</span> QP, <span class='keyword'>auto</span> R2, <span class='keyword'>typename</span> Rep2<span class='anglebracket'>&gt;</span>
<span class='keyword'>requires</span> <i ><span class='texttt'>see below</span></i>
<span class='keyword'>friend</span> <span class='keyword'>constexpr</span> <span class='keyword'>decltype</span><span class='parenthesis'>(</span><span class='keyword'>auto</span><span class='parenthesis'>)</span> <span class='keyword'>operator</span><span class='operator'>+</span><span class='operator'>=</span><span class='parenthesis'>(</span>QP<span class='operator'>&amp;</span><span class='operator'>&amp;</span> qp, <span class='keyword'>const</span> quantity<span class='anglebracket'>&lt;</span>R2, Rep2<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span> q<span class='parenthesis'>)</span>;
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><a class='index' id='conceptref:Mutable_'></a><span class='texttt'><i >Mutable</i></span><span class='anglebracket'>&lt;</span>quantity_point<span class='anglebracket'>&gt;</span> QP, <span class='keyword'>auto</span> R2, <span class='keyword'>typename</span> Rep2<span class='anglebracket'>&gt;</span>
<span class='keyword'>requires</span> <i ><span class='texttt'>see below</span></i>
<span class='keyword'>friend</span> <span class='keyword'>constexpr</span> <span class='keyword'>decltype</span><span class='parenthesis'>(</span><span class='keyword'>auto</span><span class='parenthesis'>)</span> <span class='keyword'>operator</span><span class='operator'>-</span><span class='operator'>=</span><span class='parenthesis'>(</span>QP<span class='operator'>&amp;</span><span class='operator'>&amp;</span> qp, <span class='keyword'>const</span> quantity<span class='anglebracket'>&lt;</span>R2, Rep2<span class='anglebracket'>&gt;</span><span class='operator'>&amp;</span> q<span class='parenthesis'>)</span>;
</code></div></div></div></div></div></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-units94d7b2bb104446bf4399cd3942b7c74dff32c269/source/quantities.tex#L6301'>#</a></div><div class='texpara'><div id='1.sentence-1' class='sentence'>Let <span class='texttt'>@</span> be the <span class='textsf'><i >operator</i></span><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-units94d7b2bb104446bf4399cd3942b7c74dff32c269/source/quantities.tex#L6304'>#</a></div><div class='texpara'><div id='2.sentence-1' class='sentence'><i >Effects</i>: Equivalent to
<span class='texttt'>qp<span class='operator'>.</span><span class='texttt'><i >quantity-from-origin</i></span> @ q</span><a class='hidden_link' href='#2.sentence-1'>.</a></div></div></div></div><div class='para' 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-units94d7b2bb104446bf4399cd3942b7c74dff32c269/source/quantities.tex#L6309'>#</a></div><div class='texpara'><div id='3.sentence-1' class='sentence'><i >Returns</i>: <span class='texttt'>std<span class='operator'>&#x200b;::&#x200b;</span>forward<span class='anglebracket'>&lt;</span>QP<span class='anglebracket'>&gt;</span><span class='parenthesis'>(</span>qp<span class='parenthesis'>)</span></span><a class='hidden_link' href='#3.sentence-1'>.</a></div></div></div></div><div class='para' id='4'><div class='marginalizedparent'><a class='marginalized' href='#4'>4</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/mpusz/mp-units94d7b2bb104446bf4399cd3942b7c74dff32c269/source/quantities.tex#L6313'>#</a></div><div class='texpara'><div id='4.sentence-1' class='sentence'><i >Remarks</i>: The expression in the <span class='textsf'><i >requires-clause</i></span> is equivalent to:
<span class='codeblock'><a class='index' id='conceptref:QuantityConvertibleTo'></a><i >QuantityConvertibleTo</i><span class='anglebracket'>&lt;</span>quantity<span class='anglebracket'>&lt;</span>R2, Rep2<span class='anglebracket'>&gt;</span>, quantity_type<span class='anglebracket'>&gt;</span> <span class='operator'>&amp;</span><span class='operator'>&amp;</span>
<span class='keyword'>requires</span> <span class='curlybracket'>{</span> qp<span class='operator'>.</span><i >quantity-from-origin</i> @ q; <span class='curlybracket'>}</span>
</span></div></div></div></div></div></body></html>