tmp/tmpzd0k8ayf/{from.md → to.md}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
#### Swap <a id="variant.swap">[[variant.swap]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
void swap(variant& rhs) noexcept(see below);
|
| 5 |
```
|
| 6 |
|
| 7 |
*Mandates:* `is_move_constructible_v<``Tᵢ``>` is `true` for all i.
|
| 8 |
|
| 9 |
-
*Preconditions:*
|
| 10 |
-
|
| 11 |
|
| 12 |
*Effects:*
|
| 13 |
|
| 14 |
- If `valueless_by_exception() && rhs.valueless_by_exception()` no
|
| 15 |
effect.
|
|
@@ -27,9 +27,9 @@ with i being `index()` and j being `rhs.index()`.
|
|
| 27 |
values of `*this` and of `rhs` are determined by the exception safety
|
| 28 |
guarantee of `swap` for lvalues of `Tᵢ` with i being `index()`. If an
|
| 29 |
exception is thrown during the exchange of the values of `*this` and
|
| 30 |
`rhs`, the states of the values of `*this` and of `rhs` are determined
|
| 31 |
by the exception safety guarantee of `variant`’s move constructor. The
|
| 32 |
-
|
| 33 |
`is_nothrow_move_constructible_v<``Tᵢ``> && is_nothrow_swappable_v<``Tᵢ``>`
|
| 34 |
for all i.
|
| 35 |
|
|
|
|
| 1 |
#### Swap <a id="variant.swap">[[variant.swap]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
constexpr void swap(variant& rhs) noexcept(see below);
|
| 5 |
```
|
| 6 |
|
| 7 |
*Mandates:* `is_move_constructible_v<``Tᵢ``>` is `true` for all i.
|
| 8 |
|
| 9 |
+
*Preconditions:* Each `Tᵢ` meets the *Cpp17Swappable*
|
| 10 |
+
requirements [[swappable.requirements]].
|
| 11 |
|
| 12 |
*Effects:*
|
| 13 |
|
| 14 |
- If `valueless_by_exception() && rhs.valueless_by_exception()` no
|
| 15 |
effect.
|
|
|
|
| 27 |
values of `*this` and of `rhs` are determined by the exception safety
|
| 28 |
guarantee of `swap` for lvalues of `Tᵢ` with i being `index()`. If an
|
| 29 |
exception is thrown during the exchange of the values of `*this` and
|
| 30 |
`rhs`, the states of the values of `*this` and of `rhs` are determined
|
| 31 |
by the exception safety guarantee of `variant`’s move constructor. The
|
| 32 |
+
exception specification is equivalent to the logical of
|
| 33 |
`is_nothrow_move_constructible_v<``Tᵢ``> && is_nothrow_swappable_v<``Tᵢ``>`
|
| 34 |
for all i.
|
| 35 |
|