From Jason Turner

[tuple.assign]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmptgge5c03/{from.md → to.md} +40 -37
tmp/tmptgge5c03/{from.md → to.md} RENAMED
@@ -1,96 +1,99 @@
1
  #### Assignment <a id="tuple.assign">[[tuple.assign]]</a>
2
 
3
  For each `tuple` assignment operator, an exception is thrown only if the
4
  assignment of one of the types in `Types` throws an exception. In the
5
  function descriptions that follow, let i be in the range \[`0`,
6
- `sizeof...(Types)`) in order, Tᵢ be the iᵗʰ type in `Types`, and Uᵢ be
7
- the iᵗʰ type in a template parameter pack named `UTypes`, where indexing
8
- is zero-based.
9
 
10
  ``` cpp
11
  tuple& operator=(const tuple& u);
12
  ```
13
 
14
- *Requires:* `is_copy_assignable<`Tᵢ`>::value` is `true` for all i.
15
-
16
  *Effects:* Assigns each element of `u` to the corresponding element of
17
  `*this`.
18
 
19
- *Returns:* `*this`
 
 
 
20
 
21
  ``` cpp
22
  tuple& operator=(tuple&& u) noexcept(see below);
23
  ```
24
 
25
- The expression inside `noexcept` is equivalent to the logical
 
 
 
 
 
 
26
  <span class="smallcaps">and</span> of the following expressions:
27
 
28
  ``` cpp
29
- is_nothrow_move_assignable<Tᵢ>::value
30
  ```
31
 
32
  where Tᵢ is the iᵗʰ type in `Types`.
33
 
34
- *Requires:* `is_move_assignable<`Tᵢ`>::value` is `true` for all i.
35
-
36
- *Effects:* For all i, assigns `std::forward<`Tᵢ`>(get<`i`>(u))` to
37
- `get<`i`>(*this)`.
38
-
39
  *Returns:* `*this`.
40
 
41
  ``` cpp
42
- template <class... UTypes>
43
- tuple& operator=(const tuple<UTypes...>& u);
44
  ```
45
 
46
- *Requires:* `sizeof...(Types) == sizeof...(UTypes)` and
47
- `is_assignable<`Tᵢ`&, const `Uᵢ`&>::value` is `true` for all i.
48
-
49
  *Effects:* Assigns each element of `u` to the corresponding element of
50
  `*this`.
51
 
52
- *Returns:* `*this`
 
 
 
 
53
 
54
  ``` cpp
55
- template <class... UTypes>
56
- tuple& operator=(tuple<UTypes...>&& u);
57
  ```
58
 
59
- *Requires:* `is_assignable<Ti&, Ui&&>::value == true` for all `i`.
60
- `sizeof...(Types)` `==`
61
- `sizeof...(UTypes)`.
62
-
63
- *Effects:* For all i, assigns `std::forward<`Uᵢ`>(get<`i`)>(u))` to
64
  `get<`i`>(*this)`.
65
 
 
 
 
 
66
  *Returns:* `*this`.
67
 
68
  ``` cpp
69
  template <class U1, class U2> tuple& operator=(const pair<U1, U2>& u);
70
  ```
71
 
72
- *Requires:* `sizeof...(Types) == 2`.
73
- `is_assignable<`T₀`&, const U1&>::value` is `true` for the first type T₀
74
- in `Types` and `is_assignable<`T₁`&, const U2&>::value` is `true` for
75
- the second type T₁ in `Types`.
76
-
77
  *Effects:* Assigns `u.first` to the first element of `*this` and
78
  `u.second` to the second element of `*this`.
79
 
80
- *Returns:* `*this`
 
 
 
 
 
 
81
 
82
  ``` cpp
83
  template <class U1, class U2> tuple& operator=(pair<U1, U2>&& u);
84
  ```
85
 
86
- *Requires:* `sizeof...(Types) == 2`. `is_assignable<`T₀`&, U1&&>::value`
87
- is `true` for the first type T₀ in `Types` and
88
- `is_assignable<`T₁`&, U2&&>::value` is `true` for the second type T₁ in
89
- `Types`.
90
-
91
  *Effects:* Assigns `std::forward<U1>(u.first)` to the first element of
92
  `*this` and
93
  `std::forward<U2>(u.second)` to the second element of `*this`.
94
 
 
 
 
 
 
 
95
  *Returns:* `*this`.
96
 
 
1
  #### Assignment <a id="tuple.assign">[[tuple.assign]]</a>
2
 
3
  For each `tuple` assignment operator, an exception is thrown only if the
4
  assignment of one of the types in `Types` throws an exception. In the
5
  function descriptions that follow, let i be in the range \[`0`,
6
+ `sizeof...(Types)`) in order, `Tᵢ` be the iᵗʰ type in `Types`, and `Uᵢ`
7
+ be the iᵗʰ type in a template parameter pack named `UTypes`, where
8
+ indexing is zero-based.
9
 
10
  ``` cpp
11
  tuple& operator=(const tuple& u);
12
  ```
13
 
 
 
14
  *Effects:* Assigns each element of `u` to the corresponding element of
15
  `*this`.
16
 
17
+ *Remarks:* This operator shall be defined as deleted unless
18
+ `is_copy_assignable_v<``Tᵢ``>` is `true` for all i.
19
+
20
+ *Returns:* `*this`.
21
 
22
  ``` cpp
23
  tuple& operator=(tuple&& u) noexcept(see below);
24
  ```
25
 
26
+ *Effects:* For all i, assigns `std::forward<``Tᵢ``>(get<`i`>(u))` to
27
+ `get<`i`>(*this)`.
28
+
29
+ *Remarks:* This operator shall be defined as deleted unless
30
+ `is_move_assignable_v<``Tᵢ``>` is `true` for all i.
31
+
32
+ *Remarks:* The expression inside `noexcept` is equivalent to the logical
33
  <span class="smallcaps">and</span> of the following expressions:
34
 
35
  ``` cpp
36
+ is_nothrow_move_assignable_v<Tᵢ>
37
  ```
38
 
39
  where Tᵢ is the iᵗʰ type in `Types`.
40
 
 
 
 
 
 
41
  *Returns:* `*this`.
42
 
43
  ``` cpp
44
+ template <class... UTypes> tuple& operator=(const tuple<UTypes...>& u);
 
45
  ```
46
 
 
 
 
47
  *Effects:* Assigns each element of `u` to the corresponding element of
48
  `*this`.
49
 
50
+ *Remarks:* This operator shall not participate in overload resolution
51
+ unless `sizeof...(Types) == sizeof...(UTypes)` and
52
+ `is_assignable_v<``Tᵢ``&, const ``Uᵢ``&>` is `true` for all i.
53
+
54
+ *Returns:* `*this`.
55
 
56
  ``` cpp
57
+ template <class... UTypes> tuple& operator=(tuple<UTypes...>&& u);
 
58
  ```
59
 
60
+ *Effects:* For all i, assigns `std::forward<``Uᵢ``>(get<`i`>(u))` to
 
 
 
 
61
  `get<`i`>(*this)`.
62
 
63
+ *Remarks:* This operator shall not participate in overload resolution
64
+ unless `is_assignable_v<``Tᵢ``&, ``Uᵢ``&&> == true` for all i and
65
+ `sizeof...(Types) == sizeof...(UTypes)`.
66
+
67
  *Returns:* `*this`.
68
 
69
  ``` cpp
70
  template <class U1, class U2> tuple& operator=(const pair<U1, U2>& u);
71
  ```
72
 
 
 
 
 
 
73
  *Effects:* Assigns `u.first` to the first element of `*this` and
74
  `u.second` to the second element of `*this`.
75
 
76
+ *Remarks:* This operator shall not participate in overload resolution
77
+ unless `sizeof...(Types) == 2` and `is_assignable_v<``T₀``&, const U1&>`
78
+ is `true` for the first type `T₀` in `Types` and
79
+ `is_assignable_v<``T₁``&, const U2&>` is `true` for the second type `T₁`
80
+ in `Types`.
81
+
82
+ *Returns:* `*this`.
83
 
84
  ``` cpp
85
  template <class U1, class U2> tuple& operator=(pair<U1, U2>&& u);
86
  ```
87
 
 
 
 
 
 
88
  *Effects:* Assigns `std::forward<U1>(u.first)` to the first element of
89
  `*this` and
90
  `std::forward<U2>(u.second)` to the second element of `*this`.
91
 
92
+ *Remarks:* This operator shall not participate in overload resolution
93
+ unless `sizeof...(Types) == 2` and `is_assignable_v<``T₀``&, U1&&>` is
94
+ `true` for the first type `T₀` in `Types` and
95
+ `is_assignable_v<``T₁``&, U2&&>` is `true` for the second type `T₁` in
96
+ `Types`.
97
+
98
  *Returns:* `*this`.
99