ComparablePair<T1 extends Comparable, T2 extends Comparable> extension
Adds C++ <utility> relational operators securely without sacrificing generic safety.
These operators (<, <=, >, >=, compareTo) automatically unlock
when both T1 and T2 happen to extend Comparable.
- on
-
- Pair<
T1, T2>
- Pair<
Methods
-
compareTo(
Pair< T1, T2> other) → int -
Available on Pair<
Compares this pair lexicographically withT1, T2> , provided by the ComparablePair extensionother.
Operators
-
operator <(
Pair< T1, T2> other) → bool -
Available on Pair<
Returns whether this pair is lexicographically less thanT1, T2> , provided by the ComparablePair extensionother. -
operator <=(
Pair< T1, T2> other) → bool -
Available on Pair<
Returns whether this pair is lexicographically less than or equal toT1, T2> , provided by the ComparablePair extensionother. -
operator >(
Pair< T1, T2> other) → bool -
Available on Pair<
Returns whether this pair is lexicographically greater thanT1, T2> , provided by the ComparablePair extensionother. -
operator >=(
Pair< T1, T2> other) → bool -
Available on Pair<
Returns whether this pair is lexicographically greater than or equal toT1, T2> , provided by the ComparablePair extensionother.