Boost logo

Boost :

Subject: Re: [boost] [outcome v2] Please comment on new result<T, EC> reference API docs
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-06-21 23:58:24

On 22/06/2017 00:21, Peter Dimov via Boost wrote:
> Niall, what does result<R, void> represent?

Same as expected<R, void>.

It's legal to return that failure occurred, but no information as to
why. I see that as being possibly useful.

What's far more interesting is result<void, void>. Yes expected<void,
void> is also legal too. Where things get mind bendy is that v2
result<T, E> can return a T with additional info E, so you can quite
legitimately have a result<void, void> with both .has_value() and
.has_error() returning true.

I agree before you say it that that is daft. But I see no good reason to
not support it other than "that is daft". And besides, outcome<void,
void, exception_ptr> looks much more useful, and that would have a
result<void, void> internally, so there is a real actual use case for
result<void, void>.


ned Productions Limited Consulting

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