<!DOCTYPE html><htmllang='en'><head><title>[qty.pt.arith.ops]</title><metacharset='UTF-8'/><linkrel='stylesheet'type='text/css'href='14882.css'/><linkrel='stylesheet'type='text/css'href='https://fonts.googleapis.com/css2?family=Noto+Serif'/><linkrel='stylesheet'type='text/css'href='https://fonts.googleapis.com/css2?family=Noto+Sans'/><linkrel='stylesheet'type='text/css'href='https://fonts.googleapis.com/css2?family=Noto+Sans+Mono'/><linkrel='icon'href='icon.png'/><linkrel='stylesheet'type='text/css'href='expanded.css'title='Normal'/><linkrel='alternate stylesheet'type='text/css'href='colored.css'title='Notes and examples colored'/><linkrel='alternate stylesheet'type='text/css'href='normative-only.css'title='Notes and examples hidden'/></head><body><divclass='wrapper'><h1><aclass='secnum'style='min-width:50pt'>5</a> Quantities and units library <aclass='abbr_ref'href='index.html#quantities'>[quantities]</a></h1><h2><aclass='secnum'style='min-width:65pt'>5.7</a> Quantity point <aclass='abbr_ref'href='qty.pt.html#arith.ops'>[qty.pt]</a></h2><h3><aclass='secnum'style='min-width:80pt'>5.7.12</a> Arithmetic operations <aclass='abbr_ref'>[qty.pt.arith.ops]</a></h3><divclass='para'id='1'><divclass='marginalizedparent'><aclass='marginalized'href='#1'>1</a></div><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L6324'>#</a></div><divclass='texpara'><divid='1.sentence-1'class='sentence'>In the following descriptions,
let <spanclass='texttt'>@</span> be the <spanclass='textsf'><i>operator</i></span><aclass='hidden_link'href='#1.sentence-1'>.</a></div></div></div><divclass='texpara'><divid='lib:quantity,operator-'><divid='lib:operator-,quantity'><divid='lib:quantity_point,operator-'><divid='lib:operator-,quantity_point'><divid='lib:quantity,operator+'><divid='lib:operator+,quantity'><divid='lib:quantity_point,operator+'><divid='lib:operator+,quantity_point'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:operator+,quantity_point'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span>std<spanclass='operator'>::</span>derived_from<spanclass='anglebracket'><</span>quantity_point<spanclass='anglebracket'>></span> QP, <spanclass='keyword'>auto</span> R2, <spanclass='keyword'>typename</span> Rep2<spanclass='anglebracket'>></span>
</code></div></div></div></div></div></div></div></div></div></div><divclass='para'id='2'><divclass='marginalizedparent'><aclass='marginalized'href='#2'>2</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L6345'>#</a></div><divclass='texpara'><divid='2.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
<spanclass='keyword'>return</span><spanclass='operator'>::</span>mp_units<spanclass='operator'>::</span>quantity_point<spanclass='curlybracket'>{</span>qp<spanclass='operator'>.</span>quantity_ref_from<spanclass='parenthesis'>(</span>PO<spanclass='parenthesis'>)</span> @ q, PO<spanclass='curlybracket'>}</span>;
</span></div></div></div></div><divclass='para'id='3'><divclass='marginalizedparent'><aclass='marginalized'href='#3'>3</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L6355'>#</a></div><divclass='texpara'><divid='3.sentence-1'class='sentence'><i>Remarks</i>: The expression in the <spanclass='textsf'><i>requires-clause</i></span> is equivalent to:
</code></div></div></div></div><divclass='para'id='4'><divclass='marginalizedparent'><aclass='marginalized'href='#4'>4</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L6373'>#</a></div><divclass='texpara'><divid='4.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
</span></div></div></div></div><divclass='para'id='5'><divclass='marginalizedparent'><aclass='marginalized'href='#5'>5</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L6381'>#</a></div><divclass='texpara'><divid='5.sentence-1'class='sentence'><i>Remarks</i>: The expression in the <spanclass='textsf'><i>requires-clause</i></span> is equivalent to:
</span></div></div></div></div><divclass='para'id='6'><divclass='marginalizedparent'><aclass='marginalized'href='#6'>6</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L6388'>#</a></div><divclass='texpara'><divid='6.sentence-1'class='sentence'><i>Recommended practice</i>: The subtraction of two equal origins is not evaluated<aclass='hidden_link'href='#6.sentence-1'>.</a></div></div></div></div><divclass='texpara'><divid='lib:PointOrigin,operator-'><divid='lib:operator-,PointOrigin'><divid='lib:quantity_point,operator-__'><divid='lib:operator-,quantity_point__'><divclass='itemdecl'><divclass='marginalizedparent'><aclass='itemDeclLink'href='#lib:operator-,quantity_point__'>🔗</a></div><codeclass='itemdeclcode'><spanclass='keyword'>template</span><spanclass='anglebracket'><</span>std<spanclass='operator'>::</span>derived_from<spanclass='anglebracket'><</span>quantity_point<spanclass='anglebracket'>></span> QP, <ahref='qty.pt.orig.concepts.html#concept:PointOrigin'title='5.7.2.2 Concepts [qty.pt.orig.concepts]'><spanid='conceptref:PointOrigin'><spanclass='texttt'>PointOrigin</span></span></a> PO2<spanclass='anglebracket'>></span>
</code></div></div></div></div></div></div><divclass='para'id='7'><divclass='marginalizedparent'><aclass='marginalized'href='#7'>7</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L6405'>#</a></div><divclass='texpara'><divid='7.sentence-1'class='sentence'><i>Effects</i>: For the first signature,
equivalent to: <spanclass='texttt'><spanclass='keyword'>return</span><spanclass='operator'>-</span><spanclass='parenthesis'>(</span>qp <spanclass='operator'>-</span> po<spanclass='parenthesis'>)</span>;</span></div></div></div></div><divclass='para'id='8'><divclass='marginalizedparent'><aclass='marginalized'href='#8'>8</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L6424'>#</a></div><divclass='texpara'><divid='8.sentence-1'class='sentence'><i>Remarks</i>: The expression in the <spanclass='textsf'><i>requires-clause</i></span> is equivalent to:
</span></div></div></div></div><divclass='para'id='9'><divclass='marginalizedparent'><aclass='marginalized'href='#9'>9</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-units329ffdaacb1bd7bed08565ac80d9eef7ccb1e5b5/source/quantities.tex#L6432'>#</a></div><divclass='texpara'><divid='9.sentence-1'class='sentence'><i>Recommended practice</i>: The subtraction of two equal origins is not evaluated<aclass='hidden_link'href='#9.sentence-1'>.</a></div></div></div></div></div></body></html>