Topic: Return type of expected::emplace


Author: jgottman6@gmail.com
Date: Sat, 17 Feb 2018 12:16:10 -0800 (PST)
Raw View
------=_Part_1971_1327359545.1518898570891
Content-Type: multipart/alternative;
 boundary="----=_Part_1972_1489141142.1518898570891"

------=_Part_1972_1489141142.1518898570891
Content-Type: text/plain; charset="UTF-8"

According to the most recent paper for the proposed expected<,T, E> class
template,  p0323r5 <http://en.cppreference.com/w/cpp/utility/any/emplace>,
the return type of the emplace() method is void.   The  emplace() method of
std::optional<T> has recently been changed to return T&, in order  to
simplify code where the new value cannot be completely set with just a
constructor call.  Several other classes have had similar changes.  I think
that this same change should be made for the expected class, for the same
reason.

Joe Gottman

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/840361e0-4c08-4818-9d1a-eab7b8a0fdb3%40isocpp.org.

------=_Part_1972_1489141142.1518898570891
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">According to the most recent paper for the proposed expect=
ed&lt;,T, E&gt; class template,=C2=A0=C2=A0<a href=3D"http://en.cppreferenc=
e.com/w/cpp/utility/any/emplace">p0323r5</a>, the return type of the emplac=
e() method is void.=C2=A0 =C2=A0The=C2=A0 emplace() method of std::optional=
&lt;T&gt; has recently been changed to return T&amp;, in order=C2=A0 to sim=
plify code where the new value cannot be completely set with just a constru=
ctor call.=C2=A0 Several other classes have had similar changes.=C2=A0 I th=
ink that this same change should be made for the expected class, for the sa=
me reason.<div><br></div><div>Joe Gottman</div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/840361e0-4c08-4818-9d1a-eab7b8a0fdb3%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/840361e0-4c08-4818-9d1a-eab7b8a0fdb3=
%40isocpp.org</a>.<br />

------=_Part_1972_1489141142.1518898570891--

------=_Part_1971_1327359545.1518898570891--

.


Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Mon, 19 Feb 2018 19:35:17 +0100
Raw View
Le 18/02/2018 =C3=A0 13:51, Daniel Kr=C3=BCgler a =C3=A9crit=C2=A0:
> 2018-02-18 10:22 GMT+01:00 Ga=C5=A1per A=C5=BEman <gasper.azman@gmail.com=
>:
>> That's a great defect proposal. Report the issue to Hal, it needs wordin=
g,
>> no?
> A defect report wouldn't go to Hal, but to the lwgchair address, if
> what we are talking about would be part of the standard. But it
> currently isn't, so it should be reported to the authors of P0323R5
> instead. It is a bit confusing, that Joe Gottman linked p0323r5 not to
> the actual proposal, but to an internet page that talks about
> any::emplace. Here is the link to the paper Joe is talking about:
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0323r5.html
>
> - Daniel
>
Hi,

we missed this change to optional/any. We would add it in JAX.

Best,

Vicente

--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/c2513ff2-b8c4-0f51-b99a-5970e2441370%40wanadoo.f=
r.

.