<!DOCTYPE html><htmllang='en'><head><title>[qty.pt.cmp]</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#cmp'>[qty.pt]</a></h2><h3><aclass='secnum'style='min-width:80pt'>5.7.13</a> Comparison <aclass='abbr_ref'>[qty.pt.cmp]</a></h3><divclass='texpara'><divid='lib:quantity_point,operator<=>'><divid='lib:operator<=>,quantity_point'><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.syn.html#concept:QuantityPointOf'title='5.7.4 Class template quantity_­point [qty.pt.syn]'><spanid='conceptref:QuantityPointOf'><spanclass='texttt'>QuantityPointOf</span></span></a><spanclass='anglebracket'><</span>absolute_point_origin<spanclass='anglebracket'>></span> QP2<spanclass='anglebracket'>></span>
</code></div></div></div></div></div></div><divclass='para'id='1'><divclass='marginalizedparent'><aclass='marginalized'href='#1'>1</a></div><divclass='itemdescr'><divclass='sourceLinkParent'><aclass='sourceLink'href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L6451'>#</a></div><divclass='texpara'><divid='1.sentence-1'class='sentence'>Let <spanclass='texttt'>@</span> be the <spanclass='textsf'><i>operator</i></span>, and
<spanclass='texttt'>std<spanclass='operator'>​::​</span>equality_<spanclass='shy'></span>comparable_<spanclass='shy'></span>with</span> if <spanclass='texttt'>@</span> is <spanclass='texttt'><spanclass='operator'>=</span><spanclass='operator'>=</span></span>, and
<spanclass='texttt'>std<spanclass='operator'>​::​</span>three_<spanclass='shy'></span>way_<spanclass='shy'></span>comparable_<spanclass='shy'></span>with</span> if <spanclass='texttt'>@</span> is <spanclass='texttt'><spanclass='anglebracket'><</span><spanclass='operator'>=</span><spanclass='anglebracket'>></span></span><aclass='hidden_link'href='#1.sentence-1'>.</a></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-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L6457'>#</a></div><divclass='texpara'><divid='2.sentence-1'class='sentence'><i>Effects</i>: Equivalent to:
</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-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L6464'>#</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:
</span></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-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L6471'>#</a></div><divclass='texpara'><divid='4.sentence-1'class='sentence'><i>Recommended practice</i>: If the origins are equal, instead evaluate