Boost logo

Boost :

Subject: Re: [boost] [review] Review of Outcome v2 (Fri-19-Jan to Sun-28-Jan, 2018)
From: Peter Dimov (lists_at_[hidden])
Date: 2018-02-03 00:39:34


Niall Douglas wrote:

> My secondary use case is that rather than encode the logic for how to type
> erase/rethrow/convert the failure into an exception throw via a
> preprocessor macro which is how it's usually done e.g.
> BOOST_THROW_EXCEPTION(), ...

The macro is only needed to capture __FILE__ and __LINE__. If we get
std::source_location, it won't be necessary.

> What doomed exception specifications is indirect function calls combined
> with the side channel exception throws operate through, so your function
> which guarantees to never throw anything but E happens to call some
> overriden virtual function which throws a different type, and boom you've
> just called std::terminate.

No, you don't; the overrider is required to have a matching exception
specification.

What doomed exception specifications is that they just aren't useful. They
solve a problem that doesn't need solving.


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