Topic: std::optional - move is conditionally nothrow, what


Author: =?UTF-8?Q?R=C3=B3bert_D=C3=A1vid?= <lrdxgm@gmail.com>
Date: Tue, 11 Jun 2013 12:51:24 -0700 (PDT)
Raw View
------=_Part_87_7610263.1370980284804
Content-Type: text/plain; charset=ISO-8859-1

Hello,

I just noticed that in the last draft, std::optional<T> has a move
constructor that is nothrow(is_nothrow_move_constructible<T>::value), and
has a move-assignment operator that is nothrow(is_nothrow_move_assignable<T>::value
&& is_nothrow_move_constructible<T>::value) (I think move-constructable for
the case of assigning to a disengaged object).

Now, there are no similar requirements for the copy constructor. Is there
any reason why is it not nothrow(is_nothrow_copy_constructible<T>::value),
and similarly for the move-assignment operator?

Thank you, Robert

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



------=_Part_87_7610263.1370980284804
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,<br><br>I just noticed that in the last draft, <span style=3D"font-fa=
mily: courier new,monospace;">std::optional&lt;T&gt;</span> has a move cons=
tructor that is <span style=3D"font-family: courier new,monospace;">nothrow=
(is_nothrow_move_constructible&lt;T&gt;::value)</span>, and has a=20
move-assignment operator that is <span style=3D"font-family: courier new,mo=
nospace;">nothrow(is_nothrow_move_assignable&lt;T&gt;::value &amp;&amp;=20
is_nothrow_move_constructible&lt;T&gt;::value)</span> (I think move-constru=
ctable for=20
the case of assigning to a disengaged object).<br><br>Now, there are no sim=
ilar requirements for the copy constructor. Is there any reason why is it n=
ot
 <span style=3D"font-family: courier new,monospace;">nothrow(is_nothrow_cop=
y_constructible&lt;T&gt;::value)</span>, and similarly=20
for the move-assignment operator?<br><br>Thank you, Robert

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_87_7610263.1370980284804--

.