14 Sep
2018
14 Sep
'18
5:03 p.m.
On Fri, Sep 14, 2018 at 12:06 AM Alexander Grund via Boost < boost@lists.boost.org> wrote:
And my other question was, are we sure that anyone is using Outcome for this use case. If the answer approaches "no", that is, if nearly all users of Outcome use it only to design exception-free interfaces, it might be better to provide this functionality in a different library. Isn't that what optional is for? If you don't want value-or-error semantics but rather maybe-value semantics, then that's optional<>.
No, because optional would just throw std::bad_optional_access, whereas in this case you still want the exception to indicate what went wrong with the operation which was attempted.