You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<cxx-remarks>The function shall not participate in overload resolution unless <code>is_constructible_v<T, initializer_list<U>&, Args&&...></code> is <code>true</code>.
233
238
If <code>T</code>'s constructor selected for the initialization is a <code>constexpr</code> constructor, this constructor shall be a <code>constexpr</code> constructor.</cxx-remarks>
234
239
</cxx-function>
240
+
241
+
<cxx-note>The following constructors are conditionally specified as <code>explicit</code>. This is typically implemented by declaring two such constructors, of which at most one participates in overload resolution.</cxx-note>
<cxx-effects>Initializes the contained value as if direct-non-list-initializing an object of type <code>T</code> with the expression <code>std::forward<U>(v)</code>.</cxx-effects>
248
+
<cxx-postconditions><code>*this</code> contains a value.</cxx-postconditions>
249
+
<cxx-throws>Any exception thrown by the selected constructor of <code>T</code>.</cxx-throws>
250
+
<cxx-remarks>If <code>T</code>'s selected constructor is a <code>constexpr</code> constructor, this constructor shall be a <code>constexpr</code> constructor.
251
+
This constructor shall not participate in overload resolution unless <code>is_constructible_v<T, U&&></code> is <code>true</code> and <code>U</code> is not the same type as <code>T</code>.
252
+
The constructor is <code>explicit</code> if and only if <code>is_convertible_v<U&&, T></code> is <code>false</code>.</cxx-remarks>
<cxx-effects>If <code>rhs</code> contains a value, initializes the contained value as if direct-non-list-initializing an object of type <code>T</code> with the expression <code>*rhs</code>.</cxx-effects>
<cxx-throws>Any exception thrown by the selected constructor of <code>T</code>.</cxx-throws>
262
+
<cxx-remarks>If <code>T</code>'s selected constructor is a <code>constexpr</code> constructor, this constructor shall be a <code>constexpr</code> constructor.
263
+
This constructor shall not participate in overload resolution unless <code>is_constructible_v<T, const U&></code> is <code>true</code>, <code>is_same<decay_t<U>, T></code> is <code>false</code>, <code>is_constructible_v<T, const optional<U>&></code> is <code>false</code> and <code>is_convertible_v<const optional<U>&, T></code> is <code>false</code>.
264
+
The constructor is <code>explicit</code> if and only if <code>is_convertible_v<const U&, T></code> is <code>false</code>.</cxx-remarks>
<cxx-effects>If <code>rhs</code> contains a value, initializes the contained value as if direct-non-list-initializing an object of type <code>T</code> with the expression <code>std::move(*rhs)</code>. <code>bool(rhs)</code> is unchanged.</cxx-effects>
<cxx-throws>Any exception thrown by the selected constructor of <code>T</code>.</cxx-throws>
274
+
<cxx-remarks>If <code>T</code>'s selected constructor is a <code>constexpr</code> constructor, this constructor shall be a <code>constexpr</code> constructor.
275
+
This constructor shall not participate in overload resolution unless <code>is_constructible_v<T, U&&></code> is <code>true</code>, <code>is_same<decay_t<U>, T></code> is <code>false</code>, <code>is_constructible_v<T, optional<U>&&></code> is <code>false</code> and <code>is_convertible_v<optional<U>&&, T></code> is <code>false</code> and <code>U</code> is not the same type as <code>T</code>.
276
+
The constructor is <code>explicit</code> if and only if <code>is_convertible_v<U&&, T></code> is <code>false</code>.</cxx-remarks>
277
+
</cxx-function>
235
278
</cxx-section>
236
279
237
280
<cxx-sectionid="optional.object.dtor">
@@ -340,9 +383,72 @@ <h1>Assignment</h1>
340
383
<cxx-remarks>
341
384
<p>If any exception is thrown, the result of the expression <code>bool(*this)</code> remains unchanged. If an exception is thrown during the call to <code>T</code>'s constructor, the state of <code><var>v</var></code> is determined by the exception safety guarantee of <code>T</code>'s constructor. If an exception is thrown during the call to <code>T</code>'s assignment, the state of <code><var>*val</var></code> and <code><var>v</var></code> is determined by the exception safety guarantee of <code>T</code>'s assignment.</p>
342
385
<p>The function shall not participate in overload resolution unless
343
-
<code>is_same_v<decay_t<U>, T></code> is <code>true</code>.</p>
386
+
<code>decay_t<U></code> is not <code>nullopt_t</code> and <code>decay_t<U></code> is not a specialization of <code>optional</code>.</p>
344
387
</cxx-remarks>
345
-
<cxx-notes>The reason for providing such generic assignment and then constraining it so that effectively <code>T</code> == <code>U</code> is to guarantee that assignment of the form <code>o = {}</code> is unambiguous.</cxx-notes>
<cxx-requires><code>is_constructible_v<T, const U&></code> is <code>true</code> and <code>is_assignable_v<T&, const U&></code> is <code>true</code>.</cxx-requires>
<cxx-remarks>If any exception is thrown, the result of the expression <code>bool(*this)</code> remains unchanged.
417
+
If an exception is thrown during the call to <code>T</code>'s constructor, the state of <code>*rhs.val</code> is determined by the exception safety guarantee of <code>T</code>'s constructor.
418
+
If an exception is thrown during the call to <code>T</code>'s assignment, the state of <code>*val</code> and <code>*rhs.val</code> is determined by the exception safety guarantee of <code>T</code>'s assignment.
419
+
The function shall not participate in overload resolution unless <code>is_same_v<decay_t<U>, T></code> is <code>false</code>.</cxx-remarks>
<cxx-requires><code>is_constructible_v<T, U></code> is <code>true</code> and <code>is_assignable_v<T&, U></code> is <code>true</code>.</cxx-requires>
426
+
<cxx-effects>The result of the expression <code>bool(rhs)</code> remains unchanged.
<cxx-remarks>If any exception is thrown, the result of the expression <code>bool(*this)</code> remains unchanged.
449
+
If an exception is thrown during the call to <code>T</code>'s constructor, the state of <code>*rhs.val</code> is determined by the exception safety guarantee of <code>T</code>'s constructor.
450
+
If an exception is thrown during the call to <code>T</code>'s assignment, the state of <code>*val</code> and <code>*rhs.val</code> is determined by the exception safety guarantee of <code>T</code>'s assignment.
451
+
The function shall not participate in overload resolution unless <code>is_same_v<decay_t<U>, T></code> is false.</cxx-remarks>
0 commit comments