From Jason Turner

[tuple.swap]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpftyzowbb/{from.md → to.md} +16 -10
tmp/tmpftyzowbb/{from.md → to.md} RENAMED
@@ -1,24 +1,30 @@
1
  #### `swap` <a id="tuple.swap">[[tuple.swap]]</a>
2
 
3
  ``` cpp
4
  constexpr void swap(tuple& rhs) noexcept(see below);
 
5
  ```
6
 
7
- *Preconditions:* Each element in `*this` is swappable
8
- with [[swappable.requirements]] the corresponding element in `rhs`.
9
 
10
- *Effects:* Calls `swap` for each element in `*this` and its
11
- corresponding element in `rhs`.
12
 
13
- *Remarks:* The expression inside `noexcept` is equivalent to the logical
14
- <span class="smallcaps">and</span> of the following expressions:
 
15
 
16
- ``` cpp
17
- is_nothrow_swappable_v<Tᵢ>
18
- ```
19
 
20
- where Tᵢ is the iᵗʰ type in `Types`.
 
21
 
22
  *Throws:* Nothing unless one of the element-wise `swap` calls throws an
23
  exception.
24
 
 
 
 
 
 
 
 
1
  #### `swap` <a id="tuple.swap">[[tuple.swap]]</a>
2
 
3
  ``` cpp
4
  constexpr void swap(tuple& rhs) noexcept(see below);
5
+ constexpr void swap(const tuple& rhs) const noexcept(see below);
6
  ```
7
 
8
+ Let i be in the range \[`0`, `sizeof...(Types)`) in order.
 
9
 
10
+ *Mandates:*
 
11
 
12
+ - For the first overload, `(is_swappable_v<Types> && ...)` is `true`.
13
+ - For the second overload, `(is_swappable_v<const Types> && ...)` is
14
+ `true`.
15
 
16
+ *Preconditions:* For all i, `get<`i`>(*this)` is swappable
17
+ with [[swappable.requirements]] `get<`i`>(rhs)`.
 
18
 
19
+ *Effects:* For each i, calls `swap` for `get<`i`>(*this)` with
20
+ `get<`i`>(rhs)`.
21
 
22
  *Throws:* Nothing unless one of the element-wise `swap` calls throws an
23
  exception.
24
 
25
+ *Remarks:* The exception specification is equivalent to
26
+
27
+ - `(is_nothrow_swappable_v<Types> && ...)` for the first overload and
28
+ - `(is_nothrow_swappable_v<const Types> && ...)` for the second
29
+ overload.
30
+