Boost logo

Boost :

Subject: Re: [boost] [outcome] Requesting pre-review of Boost.Outcome tutorial
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2016-11-14 09:38:57

On 12 Nov 2016 at 14:10, Klemens Morgenstern wrote:

> Ok, I did miss the match, call, but that's basically to get the error
> out of the outcome. I meant the other way around: let outcome
> automatically capture the errors of the ctor automatically.
> I've tried to put together an example, but I failed to get it right with
> the parameter forwarding, so that ( doesn't
> work properly. I'm not sure if there is a good solution for that, but it
> hopefully demonstrates what I'm talking about.
> But since it's not as easy as I hoped, it maybe should not be part of
> outcome, but rather a wrapper holding one. On the other hand, having a
> solution that at least works with ctors, seems important to me, since
> you could have RAII with that while disabling exceptions.

I think the code you show in godbolt would make an excellent free
function helper e.g. make_outcome_nothrow<T>(Args...). I'm not keen
on adding to the emplacement constructor as that adds to all monad
construction costs whether you use the facility or not.

I've added the free function as a todo, it'll be in the presented
Outcome next Spring. Thanks for the idea Klemens.


ned Productions Limited Consulting

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