|
Adobe Source Libraries 2.0.0
A collection of C++ libraries.
|
operator< , and operator< must be a partial ordering.X | A type that is a model of LessThanComparable |
x, y, z | Object of type X |
!(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. operator< is a strict weak ordering, and if each equivalence class has only a single element, then operator< is a total ordering.| Name | Expression | Type requirements | Return type |
|---|---|---|---|
| Less | x < y | Convertible to bool | |
| Greater | x > y | Convertible to bool | |
| Less or equal | x <= y | Convertible to bool | |
| Greater or equal | x >= y | Convertible to bool |
| Name | Expression | Precondition | Semantics | Postcondition |
|---|---|---|---|---|
| Less | x < y | x and y are in the domain of < | ||
| Greater | x > y | x and y are in the domain of < | Equivalent to y < x [1] | |
| Less or equal | x <= y | x and y are in the domain of < | Equivalent to !(y < x) [1] | |
| Greater or equal | x >= y | x and y are in the domain of < | Equivalent to !(x < y) [1] |
| Irreflexivity | x < x must be false. |
| Antisymmetry | x < y implies !(y < x) [2] |
| Transitivity | x < y and y < z implies x < z [3] |
operator< is fundamental; the other inequality operators are essentially syntactic sugar. 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.