From Jason Turner

[variant.ctor]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprzmdeaq8/{from.md → to.md} +16 -20
tmp/tmprzmdeaq8/{from.md → to.md} RENAMED
@@ -15,13 +15,13 @@ type `T₀`.
15
  *Ensures:* `valueless_by_exception()` is `false` and `index()` is `0`.
16
 
17
  *Throws:* Any exception thrown by the value-initialization of `T₀`.
18
 
19
  *Remarks:* This function is `constexpr` if and only if the
20
- value-initialization of the alternative type `T₀` would satisfy the
21
- requirements for a constexpr function. The expression inside `noexcept`
22
- is equivalent to `is_nothrow_default_constructible_v<``T₀``>`.
23
 
24
  [*Note 1*: See also class `monostate`. — *end note*]
25
 
26
  ``` cpp
27
  constexpr variant(const variant& w);
@@ -51,12 +51,12 @@ same alternative as `w` and direct-initializes the contained value with
51
  `get<j>(std::move(w))`, where `j` is `w.index()`. Otherwise, initializes
52
  the `variant` to not hold a value.
53
 
54
  *Throws:* Any exception thrown by move-constructing any `Tᵢ` for all i.
55
 
56
- *Remarks:* The expression inside `noexcept` is equivalent to the logical
57
- of `is_nothrow_move_constructible_v<``Tᵢ``>` for all i. If
58
  `is_trivially_move_constructible_v<``Tᵢ``>` is `true` for all i, this
59
  constructor is trivial.
60
 
61
  ``` cpp
62
  template<class T> constexpr variant(T&& t) noexcept(see below);
@@ -84,19 +84,19 @@ which is the type of the contained value after construction.
84
  is ill-formed, as both alternative types have an equally viable
85
  constructor for the argument.
86
  — *end note*]
87
 
88
  *Effects:* Initializes `*this` to hold the alternative type `Tⱼ` and
89
- direct-initializes the contained value as if
90
- direct-non-list-initializing it with `std::forward<T>(t)`.
91
 
92
  *Ensures:* `holds_alternative<``Tⱼ``>(*this)` is `true`.
93
 
94
  *Throws:* Any exception thrown by the initialization of the selected
95
  alternative `Tⱼ`.
96
 
97
- *Remarks:* The expression inside `noexcept` is equivalent to
98
  `is_nothrow_constructible_v<``Tⱼ``, T>`. If `Tⱼ`’s selected constructor
99
  is a constexpr constructor, this constructor is a constexpr constructor.
100
 
101
  ``` cpp
102
  template<class T, class... Args> constexpr explicit variant(in_place_type_t<T>, Args&&... args);
@@ -105,13 +105,12 @@ template<class T, class... Args> constexpr explicit variant(in_place_type_t<T>,
105
  *Constraints:*
106
 
107
  - There is exactly one occurrence of `T` in `Types...` and
108
  - `is_constructible_v<T, Args...>` is `true`.
109
 
110
- *Effects:* Initializes the contained value as if
111
- direct-non-list-initializing an object of type `T` with the arguments
112
- `std::forward<Args>(args)...`.
113
 
114
  *Ensures:* `holds_alternative<T>(*this)` is `true`.
115
 
116
  *Throws:* Any exception thrown by calling the selected constructor of
117
  `T`.
@@ -127,13 +126,12 @@ template<class T, class U, class... Args>
127
  *Constraints:*
128
 
129
  - There is exactly one occurrence of `T` in `Types...` and
130
  - `is_constructible_v<T, initializer_list<U>&, Args...>` is `true`.
131
 
132
- *Effects:* Initializes the contained value as if
133
- direct-non-list-initializing an object of type `T` with the arguments
134
- `il, std::forward<Args>(args)...`.
135
 
136
  *Ensures:* `holds_alternative<T>(*this)` is `true`.
137
 
138
  *Throws:* Any exception thrown by calling the selected constructor of
139
  `T`.
@@ -148,13 +146,12 @@ template<size_t I, class... Args> constexpr explicit variant(in_place_index_t<I>
148
  *Constraints:*
149
 
150
  - `I` is less than `sizeof...(Types)` and
151
  - `is_constructible_v<``T_I``, Args...>` is `true`.
152
 
153
- *Effects:* Initializes the contained value as if
154
- direct-non-list-initializing an object of type `T_I` with the arguments
155
- `std::forward<Args>(args)...`.
156
 
157
  *Ensures:* `index()` is `I`.
158
 
159
  *Throws:* Any exception thrown by calling the selected constructor of
160
  `T_I`.
@@ -171,13 +168,12 @@ template<size_t I, class U, class... Args>
171
 
172
  - `I` is less than `sizeof...(Types)` and
173
  - `is_constructible_v<``T_I``, initializer_list<U>&, Args...>` is
174
  `true`.
175
 
176
- *Effects:* Initializes the contained value as if
177
- direct-non-list-initializing an object of type `T_I` with the arguments
178
- `il, std::forward<Args>(args)...`.
179
 
180
  *Ensures:* `index()` is `I`.
181
 
182
  *Remarks:* If `T_I`’s selected constructor is a constexpr constructor,
183
  this constructor is a constexpr constructor.
 
15
  *Ensures:* `valueless_by_exception()` is `false` and `index()` is `0`.
16
 
17
  *Throws:* Any exception thrown by the value-initialization of `T₀`.
18
 
19
  *Remarks:* This function is `constexpr` if and only if the
20
+ value-initialization of the alternative type `T₀` would be
21
+ constexpr-suitable [[dcl.constexpr]]. The exception specification is
22
+ equivalent to `is_nothrow_default_constructible_v<``T₀``>`.
23
 
24
  [*Note 1*: See also class `monostate`. — *end note*]
25
 
26
  ``` cpp
27
  constexpr variant(const variant& w);
 
51
  `get<j>(std::move(w))`, where `j` is `w.index()`. Otherwise, initializes
52
  the `variant` to not hold a value.
53
 
54
  *Throws:* Any exception thrown by move-constructing any `Tᵢ` for all i.
55
 
56
+ *Remarks:* The exception specification is equivalent to the logical of
57
+ `is_nothrow_move_constructible_v<``Tᵢ``>` for all i. If
58
  `is_trivially_move_constructible_v<``Tᵢ``>` is `true` for all i, this
59
  constructor is trivial.
60
 
61
  ``` cpp
62
  template<class T> constexpr variant(T&& t) noexcept(see below);
 
84
  is ill-formed, as both alternative types have an equally viable
85
  constructor for the argument.
86
  — *end note*]
87
 
88
  *Effects:* Initializes `*this` to hold the alternative type `Tⱼ` and
89
+ direct-non-list-initializes the contained value with
90
+ `std::forward<T>(t)`.
91
 
92
  *Ensures:* `holds_alternative<``Tⱼ``>(*this)` is `true`.
93
 
94
  *Throws:* Any exception thrown by the initialization of the selected
95
  alternative `Tⱼ`.
96
 
97
+ *Remarks:* The exception specification is equivalent to
98
  `is_nothrow_constructible_v<``Tⱼ``, T>`. If `Tⱼ`’s selected constructor
99
  is a constexpr constructor, this constructor is a constexpr constructor.
100
 
101
  ``` cpp
102
  template<class T, class... Args> constexpr explicit variant(in_place_type_t<T>, Args&&... args);
 
105
  *Constraints:*
106
 
107
  - There is exactly one occurrence of `T` in `Types...` and
108
  - `is_constructible_v<T, Args...>` is `true`.
109
 
110
+ *Effects:* Direct-non-list-initializes the contained value of type `T`
111
+ with `std::forward<Args>(args)...`.
 
112
 
113
  *Ensures:* `holds_alternative<T>(*this)` is `true`.
114
 
115
  *Throws:* Any exception thrown by calling the selected constructor of
116
  `T`.
 
126
  *Constraints:*
127
 
128
  - There is exactly one occurrence of `T` in `Types...` and
129
  - `is_constructible_v<T, initializer_list<U>&, Args...>` is `true`.
130
 
131
+ *Effects:* Direct-non-list-initializes the contained value of type `T`
132
+ with `il, std::forward<Args>(args)...`.
 
133
 
134
  *Ensures:* `holds_alternative<T>(*this)` is `true`.
135
 
136
  *Throws:* Any exception thrown by calling the selected constructor of
137
  `T`.
 
146
  *Constraints:*
147
 
148
  - `I` is less than `sizeof...(Types)` and
149
  - `is_constructible_v<``T_I``, Args...>` is `true`.
150
 
151
+ *Effects:* Direct-non-list-initializes the contained value of type `T_I`
152
+ with `std::forward<Args>(args)...`.
 
153
 
154
  *Ensures:* `index()` is `I`.
155
 
156
  *Throws:* Any exception thrown by calling the selected constructor of
157
  `T_I`.
 
168
 
169
  - `I` is less than `sizeof...(Types)` and
170
  - `is_constructible_v<``T_I``, initializer_list<U>&, Args...>` is
171
  `true`.
172
 
173
+ *Effects:* Direct-non-list-initializes the contained value of type `T_I`
174
+ with `il, std::forward<Args>(args)...`.
 
175
 
176
  *Ensures:* `index()` is `I`.
177
 
178
  *Remarks:* If `T_I`’s selected constructor is a constexpr constructor,
179
  this constructor is a constexpr constructor.