Boost logo

Boost :

Subject: Re: [boost] [outcome] "sea of noexcept, islands of throwing"
From: Oswin Krause (Oswin.Krause_at_[hidden])
Date: 2017-01-17 11:24:42


Hi,

> If yes, there comes another question. One of the main reasons
> exceptions
> were introduced in the first place was to be able to report failures
> from
> functions that cannot use the return value for this purpose:
> constructors,
> conversion operators, and other operators. How do you deal with these
> functions in the sea of noexcept?

I would argue that failing to create an object is breaking so many
invariants that this awards an exception. On the other hand, we do have
an example of objects which can be constructed in a failed state, e.g.
std::ifstream which then come with their own error reporting mechanism.

Best,
Oswin


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