From Jason Turner

[variant.swap]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpvc6tu6i0/{from.md → to.md} +12 -11
tmp/tmpvc6tu6i0/{from.md → to.md} RENAMED
@@ -12,24 +12,25 @@ requirements [[swappable.requirements]].
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()`.
24
 
25
  *Remarks:* If an exception is thrown during the call to function
26
- `swap(get<`i`>(*this), get<`i`>(rhs))`, the states of the contained
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
 
 
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
18
+ `index()`.
19
  - Otherwise, exchanges values of `rhs` and `*this`.
20
 
21
  *Throws:* If `index() == rhs.index()`, any exception thrown by
22
+ `swap(`*`GET`*`<`i`>(*this), `*`GET`*`<`i`>(rhs))` with i being
23
+ `index()`. Otherwise, any exception thrown by the move constructor of
24
+ `Tᵢ` or `Tⱼ` with i being `index()` and j being `rhs.index()`.
25
 
26
  *Remarks:* If an exception is thrown during the call to function
27
+ `swap(`*`GET`*`<`i`>(*this), `*`GET`*`<`i`>(rhs))`, the states of the
28
+ contained values of `*this` and of `rhs` are determined by the exception
29
+ safety guarantee of `swap` for lvalues of `Tᵢ` with i being `index()`.
30
+ If an exception is thrown during the exchange of the values of `*this`
31
+ and `rhs`, the states of the values of `*this` and of `rhs` are
32
+ determined by the exception safety guarantee of `variant`’s move
33
+ constructor. The exception specification is equivalent to the logical of
34
  `is_nothrow_move_constructible_v<``Tᵢ``> && is_nothrow_swappable_v<``Tᵢ``>`
35
  for all i.
36