tmp/tmp44yve1l5/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Relational operators <a id="depr.relops">[[depr.relops]]</a>
|
| 2 |
+
|
| 3 |
+
The header `<utility>` has the following additions:
|
| 4 |
+
|
| 5 |
+
``` cpp
|
| 6 |
+
namespace std::rel_ops {
|
| 7 |
+
template<class T> bool operator!=(const T&, const T&);
|
| 8 |
+
template<class T> bool operator> (const T&, const T&);
|
| 9 |
+
template<class T> bool operator<=(const T&, const T&);
|
| 10 |
+
template<class T> bool operator>=(const T&, const T&);
|
| 11 |
+
}
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
To avoid redundant definitions of `operator!=` out of `operator==` and
|
| 15 |
+
operators `>`, `<=`, and `>=` out of `operator<`, the library provides
|
| 16 |
+
the following:
|
| 17 |
+
|
| 18 |
+
``` cpp
|
| 19 |
+
template<class T> bool operator!=(const T& x, const T& y);
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
*Requires:* Type `T` is *Cpp17EqualityComparable*
|
| 23 |
+
([[cpp17.equalitycomparable]]).
|
| 24 |
+
|
| 25 |
+
*Returns:* `!(x == y)`.
|
| 26 |
+
|
| 27 |
+
``` cpp
|
| 28 |
+
template<class T> bool operator>(const T& x, const T& y);
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
*Requires:* Type `T` is *Cpp17LessThanComparable*
|
| 32 |
+
([[cpp17.lessthancomparable]]).
|
| 33 |
+
|
| 34 |
+
*Returns:* `y < x`.
|
| 35 |
+
|
| 36 |
+
``` cpp
|
| 37 |
+
template<class T> bool operator<=(const T& x, const T& y);
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
*Requires:* Type `T` is *Cpp17LessThanComparable*
|
| 41 |
+
([[cpp17.lessthancomparable]]).
|
| 42 |
+
|
| 43 |
+
*Returns:* `!(y < x)`.
|
| 44 |
+
|
| 45 |
+
``` cpp
|
| 46 |
+
template<class T> bool operator>=(const T& x, const T& y);
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
*Requires:* Type `T` is *Cpp17LessThanComparable*
|
| 50 |
+
([[cpp17.lessthancomparable]]).
|
| 51 |
+
|
| 52 |
+
*Returns:* `!(x < y)`.
|
| 53 |
+
|