Boost logo

Boost :

Subject: Re: [boost] LEAF has been refactored, it now has a much simplified error handling interface
From: Sorin Fetche (sorin.fetche_at_[hidden])
Date: 2019-01-23 03:00:46

On Tue, Jan 22, 2019 at 2:34 PM Emil Dotchevski via Boost
<boost_at_[hidden]> wrote:
> Using try_ will now handle result<T> errors as well, see
> .
> With this, in your example instead of handle_all you can just use try_:
> leaf::try_(
> [i]() -> leaf::result<int> {
> LEAF_AUTO(r, f2(i));
> (void) r;
> return 0;
> },
> //handlers...

Yes, the output of the attached program shows closer to what I had in
mind, if compiled with g++ 7 or 8, release mode.

It has two problems though:
- in release mode the program crashes if I try to print
    Segmentation fault (core dumped)
- in debug mode it crashes right at the beginning
const std::exception* boost::leaf::error_info::exception() const:
Assertion `has_exception()' failed.
    Aborted (core dumped)


Boost list run by bdawes at, gregod at, cpdaniel at, john at