tmp/tmpw7rrwhnt/{from.md → to.md}
RENAMED
|
@@ -1,19 +1,22 @@
|
|
| 1 |
### Specialized algorithms <a id="pairs.spec">[[pairs.spec]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
template<class T1, class T2>
|
| 5 |
-
constexpr bool operator==(const pair<T1, T2>& x, const pair<
|
| 6 |
```
|
| 7 |
|
|
|
|
|
|
|
|
|
|
| 8 |
*Returns:* `x.first == y.first && x.second == y.second`.
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
-
template<class T1, class T2>
|
| 12 |
-
constexpr common_comparison_category_t<synth-three-way-result<T1>,
|
| 13 |
-
synth-three-way-result<T2>>
|
| 14 |
-
operator<=>(const pair<T1, T2>& x, const pair<
|
| 15 |
```
|
| 16 |
|
| 17 |
*Effects:* Equivalent to:
|
| 18 |
|
| 19 |
``` cpp
|
|
@@ -22,14 +25,20 @@ return synth-three-way(x.second, y.second);
|
|
| 22 |
```
|
| 23 |
|
| 24 |
``` cpp
|
| 25 |
template<class T1, class T2>
|
| 26 |
constexpr void swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
|
|
|
|
|
|
|
| 27 |
```
|
| 28 |
|
| 29 |
-
*Constraints:*
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
*Effects:* Equivalent to `x.swap(y)`.
|
| 33 |
|
| 34 |
``` cpp
|
| 35 |
template<class T1, class T2>
|
|
|
|
| 1 |
### Specialized algorithms <a id="pairs.spec">[[pairs.spec]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
template<class T1, class T2, class U1, class U2>
|
| 5 |
+
constexpr bool operator==(const pair<T1, T2>& x, const pair<U1, U2>& y);
|
| 6 |
```
|
| 7 |
|
| 8 |
+
*Preconditions:* Each of `decltype(x.first == y.first)` and
|
| 9 |
+
`decltype(x.second == y.second)` models `boolean-testable`.
|
| 10 |
+
|
| 11 |
*Returns:* `x.first == y.first && x.second == y.second`.
|
| 12 |
|
| 13 |
``` cpp
|
| 14 |
+
template<class T1, class T2, class U1, class U2>
|
| 15 |
+
constexpr common_comparison_category_t<synth-three-way-result<T1, U1>,
|
| 16 |
+
synth-three-way-result<T2, U2>>
|
| 17 |
+
operator<=>(const pair<T1, T2>& x, const pair<U1, U2>& y);
|
| 18 |
```
|
| 19 |
|
| 20 |
*Effects:* Equivalent to:
|
| 21 |
|
| 22 |
``` cpp
|
|
|
|
| 25 |
```
|
| 26 |
|
| 27 |
``` cpp
|
| 28 |
template<class T1, class T2>
|
| 29 |
constexpr void swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
|
| 30 |
+
template<class T1, class T2>
|
| 31 |
+
constexpr void swap(const pair<T1, T2>& x, const pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
|
| 32 |
```
|
| 33 |
|
| 34 |
+
*Constraints:*
|
| 35 |
+
|
| 36 |
+
- For the first overload, `is_swappable_v<T1>` is `true` and
|
| 37 |
+
`is_swappable_v<T2>` is `true`.
|
| 38 |
+
- For the second overload, `is_swappable_v<const T1>` is `true` and
|
| 39 |
+
`is_swappable_v<const T2>` is `true`.
|
| 40 |
|
| 41 |
*Effects:* Equivalent to `x.swap(y)`.
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
template<class T1, class T2>
|