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
Hi, I really appreciate all your work on this proposal, I really think it would be great if std::expected made it into the standard.
I have one "feature request": In the current proposal you say:
This proposal doesn't include expected references as optional [C++17] doesn't include references either. We need a future proposal.
I don't think this is a meaningful comparison. optional<T&> adds no extra functionality compared to T*, so I assume the committee probably thought it was a waste of time. On the other hand, expected<T&, Error> clearly adds additional functionality compared to T*.
In my company we have tried to take an approach similar to std::expected, packaging an optional together with an error, but it didn't get received well because of the lack of references. Nobody wants to use std::expected<std::reference_wrapper<T>, Error> as the return type to a function in an API.
The text was updated successfully, but these errors were encountered:
I believe we need a separate proposal with a good motivation and an implementation.
This is not in my priority list at this moment.
I would appreciate if someone else did it.
There are some things I believe the paper should explain. Why we don't have vector<T&>?
How often do we need it an in which cases?
Hi, I really appreciate all your work on this proposal, I really think it would be great if
std::expected
made it into the standard.I have one "feature request": In the current proposal you say:
I don't think this is a meaningful comparison.
optional<T&>
adds no extra functionality compared toT*
, so I assume the committee probably thought it was a waste of time. On the other hand,expected<T&, Error>
clearly adds additional functionality compared toT*
.In my company we have tried to take an approach similar to
std::expected
, packaging anoptional
together with an error, but it didn't get received well because of the lack of references. Nobody wants to usestd::expected<std::reference_wrapper<T>, Error>
as the return type to a function in an API.The text was updated successfully, but these errors were encountered: