Boost logo

Boost :

Subject: Re: [boost] [outcome] outcome without empty state?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-05-27 00:12:00


>> Where I'm aiming, as you'll see in the summary design document I'll
>> post shortly, is that the implicit conversion semantics will provide
>> the ability to use a less representative variety to construct things,
>> but return into a more representative variety.
>
> This holds in principle but I'm not sure that result<T> should convert
> into the hypothetical result_e<T>. From the discussion so far, I got the
> impression that we don't want to return empty results from functions; it
> seems to follow that result_e<T> would not be a return type, but the
> type of the local variable in the function that is initially empty but
> eventually acquires either a value or an error before being returned as
> result<T>.

That certainly is one design choice. I definitely have functions in
KernelTest and AFIO which would be returning a result_e<T> as the empty
return is part of the function's public contract. I gave an example of
such a function a few days ago.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/

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