tmp/tmp7t7tte57/{from.md → to.md}
RENAMED
|
@@ -2,22 +2,22 @@
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
void swap(variant& rhs) noexcept(see below);
|
| 5 |
```
|
| 6 |
|
| 7 |
-
*
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
*Effects:*
|
| 12 |
|
| 13 |
-
-
|
| 14 |
-
effect.
|
| 15 |
-
- if `index() == rhs.index()`, calls
|
| 16 |
`swap(get<`i`>(*this), get<`i`>(rhs))` where i is `index()`.
|
| 17 |
-
|
| 18 |
-
- exchanges values of `rhs` and `*this`.
|
| 19 |
|
| 20 |
*Throws:* If `index() == rhs.index()`, any exception thrown by
|
| 21 |
`swap(get<`i`>(*this), get<`i`>(rhs))` with i being `index()`.
|
| 22 |
Otherwise, any exception thrown by the move constructor of `Tᵢ` or `Tⱼ`
|
| 23 |
with i being `index()` and j being `rhs.index()`.
|
|
@@ -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 |
-
expression inside `noexcept` is equivalent to the logical
|
| 33 |
`is_nothrow_move_constructible_v<``Tᵢ``> && is_nothrow_swappable_v<``Tᵢ``>`
|
| 34 |
for all i.
|
| 35 |
|
|
|
|
| 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:* Lvalues of type `Tᵢ` are
|
| 10 |
+
swappable [[swappable.requirements]].
|
| 11 |
|
| 12 |
*Effects:*
|
| 13 |
|
| 14 |
+
- If `valueless_by_exception() && rhs.valueless_by_exception()` no
|
| 15 |
+
effect.
|
| 16 |
+
- Otherwise, if `index() == rhs.index()`, calls
|
| 17 |
`swap(get<`i`>(*this), get<`i`>(rhs))` where i is `index()`.
|
| 18 |
+
- Otherwise, exchanges values of `rhs` and `*this`.
|
|
|
|
| 19 |
|
| 20 |
*Throws:* If `index() == rhs.index()`, any exception thrown by
|
| 21 |
`swap(get<`i`>(*this), get<`i`>(rhs))` with i being `index()`.
|
| 22 |
Otherwise, any exception thrown by the move constructor of `Tᵢ` or `Tⱼ`
|
| 23 |
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 |
+
expression inside `noexcept` is equivalent to the logical of
|
| 33 |
`is_nothrow_move_constructible_v<``Tᵢ``> && is_nothrow_swappable_v<``Tᵢ``>`
|
| 34 |
for all i.
|
| 35 |
|