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
<p>Let <code>T</code> be equal to <code>decay_t<ValueType></code>.</p>
133
-
<cxx-requires><code>T</code> shall satisfy the <code>CopyConstructible</code> requirements.
133
+
<cxx-requires><code>T</code> shall satisfy the <code>CopyConstructible</code> requirements, except for the requirements for <code>MoveConstructible</code>.
134
134
If <code>is_copy_constructible_v<T></code> is false, the program is ill-formed.</cxx-requires>
135
-
<cxx-effects>Constructs an object of type <code>any</code> that contains an object of type <code>T</code> direct-initialized with <code>std::forward<ValueType>(value)</code>.</cxx-effects>
135
+
<cxx-effects>If <code>is_constructible_v<T, ValueType&&></code> is true, constructs an object of type <code>any</code> that contains an object of type <code>T</code> direct-initialized with <code>std::forward<ValueType>(value)</code>. Otherwise, constructs an object of type <code>any</code> that contains an object of type <code>T</code> direct-initialized with <code>value</code>.</cxx-effects>
136
136
<cxx-remarks>This constructor shall not participate in overload resolution if <code>decay_t<ValueType></code> is the same type as <code>any</code>.</cxx-remarks>
137
137
<cxx-throws>Any exception thrown by the selected constructor of <code>T</code>.</cxx-throws>
<cxx-requires><code>is_reference_v<ValueType></code> is true or <code>is_copy_constructible_v<ValueType></code> is true.
237
237
Otherwise the program is ill-formed.</cxx-requires>
238
238
<cxx-returns>For the first form, <code>*any_cast<add_const_t<remove_reference_t<ValueType>>>(&operand)</code>.
239
-
For the second and third forms, <code>*any_cast<remove_reference_t<ValueType>>(&operand)</code>.</cxx-returns>
239
+
For the second form, <code>*any_cast<remove_reference_t<ValueType>>(&operand)</code>.
240
+
For the third form, if <code>is_move_constructible_v<ValueType></code> is <code>true</code> and <code>is_lvalue_reference_v<ValueType></code> is <code>false</code>, <code>std::move(*any_cast<remove_reference_t<ValueType>>(&operand))</code>, otherwise, <code>*any_cast<remove_reference_t<ValueType>>(&operand)</code>.</cxx-returns>
240
241
<cxx-throws><code>bad_any_cast</code> if <code>operand.type() != typeid(remove_reference_t<ValueType>)</code>.</cxx-throws>
0 commit comments