On Wed, Sep 12, 2018 at 8:09 AM Steven Watanabe via Boost < boost@lists.boost.org> wrote:
What Niall's message fails to make clear is that the actual choice is between UB and throwing an exception. The compiler error is only to require the user to make an explicit choice between the two instead of letting the library choose.
It is still unclear to me how the user is making the choice. As far as I see it, except when exceptions are disabled (which is not standard C++), the point of using Outcome is to allow a function to return a "valueless" outcome instead of throwng an exception, which can now be postponed until the value is requested; so, if I want the exception, I can just say foo().value(). This simplifies APIs which would otherwise have to provide two variants for a function, one that throws and one that does not. Can someone clarify?