Expression | Precondition | Semantics | |
---|---|---|---|
Less | x < y | ||
Greater | x > y | Equivalent to | |
Less or equal | x <= y | Equivalent to | |
Greater or equal | x >= y | Equivalent to |
Irreflexivity | |
Antisymmetry | |
Transitivity |
• int
[1] Only
[2] Antisymmetry is a theorem, not an axiom: it follows from irreflexivity and transitivity.
[3] Because of irreflexivity and transitivity,
EqualityComparable, StrictWeakOrdering
Functions
Relational Operators
Category: utilities
Component type: function
template <class T>
bool operator!=(const T& x, const T& y);
template <class T>
bool operator>(const T& x, const T& y);
template <class T>
bool operator<=(const T& x, const T& y);
template <class T>
bool operator>=(const T& x, const T& y);
The Equality Comparable requirements specify that it must be possible to compare objects using
These four templates use
As specified in the Equality Comparable requirements,