Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
LessThanComparable
Description
A type is LessThanComparable if it is ordered: it must be possible to compare two objects of that type using operator< , and operator< must be a partial ordering.
Refinement Of
Associated Type(s)
Notation
XA type that is a model of LessThanComparable
x, y, zObject of type X
Definitions
Consider the relation !(x < y) && !(y < x). If this relation is transitive (that is, if !(x < y) && !(y < x) && !(y < z) && !(z < y) implies !(x < z) && !(z < x)), then it satisfies the mathematical definition of an equivalence relation. In this case, operator< is a strict weak ordering.
If operator< is a strict weak ordering, and if each equivalence class has only a single element, then operator< is a total ordering.
Valid Expressions
NameExpressionType requirementsReturn type
Lessx < y Convertible to bool
Greaterx > y Convertible to bool
Less or equalx <= y Convertible to bool
Greater or equalx >= y Convertible to bool
Expression Semantics
NameExpressionPreconditionSemanticsPostcondition
Lessx < yx and y are in the domain of <  
Greaterx > yx and y are in the domain of <Equivalent to y < x [1] 
Less or equalx <= yx and y are in the domain of <Equivalent to !(y < x) [1] 
Greater or equalx >= yx and y are in the domain of <Equivalent to !(x < y) [1] 
Complexity Guarantee(s)
Invariants
Irreflexivityx < x must be false.
Antisymmetryx < y implies !(y < x) [2]
Transitivityx < y and y < z implies x < z [3]
Type(s) Modeling this Concept
Notes
[1] Only operator< is fundamental; the other inequality operators are essentially syntactic sugar.
[2] Antisymmetry is a theorem, not an axiom: it follows from irreflexivity and transitivity.
[3] Because of irreflexivity and transitivity, operator< always satisfies the definition of a partial ordering. The definition of a strict weak ordering is stricter, and the definition of a total ordering is stricter still.
See Also