3.1 KiB
[depr.relops]
Annex D (normative) Compatibility features [depr]
D.14 Relational operators [depr.relops]
The header has the following additions:
namespace std::rel_ops {template bool operator!=(const T&, const T&); template bool operator> (const T&, const T&); template bool operator<=(const T&, const T&); template bool operator>=(const T&, const T&);}
To avoid redundant definitions of operator!= out of operator== and operators >, <=, and >= out of operator<, the library provides the following:
template<class T> bool operator!=(const T& x, const T& y);
Preconditions: T meets the Cpp17EqualityComparable requirements (Table 28).
Returns: !(x == y).
template<class T> bool operator>(const T& x, const T& y);
Preconditions: T meets the Cpp17LessThanComparable requirements (Table 29).
Returns: y < x.
template<class T> bool operator<=(const T& x, const T& y);
Preconditions: T meets the Cpp17LessThanComparable requirements (Table 29).
Returns: !(y < x).
template<class T> bool operator>=(const T& x, const T& y);
Preconditions: T meets the Cpp17LessThanComparable requirements (Table 29).
Returns: !(x < y).