Boost logo

Boost :

Subject: Re: [boost] LEAF has been refactored, it now has a much simplified error handling interface
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2019-01-22 22:33:44

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_:

  [i]() -> leaf::result<int> {
      LEAF_AUTO(r, f2(i));
      (void) r;
      return 0;

The only difference is that in case f2 does not throw, try_ is not
equivalent to handle_all but to handle_some, so the result<int> that will
pop out of try_ should not be discarded (in case it is communicating an
unmatched error).

By the way, in this new iteration handle_some, handle_all and try_ don't
require leaf::result<T>, they can work with any "result" type which defines
.value() and .error(), as long as .error() returns std::error_code or

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