Boost logo

Boost :

Subject: Re: [boost] [outcome] Change semantics on UB from peer review agreed semantics?
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2018-09-12 21:19:26


On Wed, Sep 12, 2018 at 8:09 AM Steven Watanabe via Boost <
boost_at_[hidden]> 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?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk