Boost logo

Boost :

Subject: Re: [boost] [outcome] expected<T&>, result<T&>
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2017-05-25 21:52:42


std::variant doesn't support references either (that was a late decision, IIRC)

I'm not sure it or optional ever will. Although maybe expected<T&>
use cases could lead the way.

Some committee members want references to work one way,
some want it to work another,
some think it is dumb to put non-Regular types into optional, so we
should *never* support references.

Tony

On Thu, May 25, 2017 at 4:33 PM, Vicente J. Botet Escriba via Boost
<boost_at_[hidden]> wrote:
> Le 25/05/2017 à 19:33, Andrzej Krzemienski via Boost a écrit :
>>
>> Niall,
>> Are Boost.Outcome monads intended to work with references (at least lvalue
>> references)?
>>
>> <snip>
>>
>> If I try it with `outcome::expected` I also get these messages, but I also
>> get a static assert saying that as per LWG decision T must be default
>> constructible.
>>
>> Vicente, does this mean you cannot use `std::expected` to return
>> references?
>>
> The proposal doesn't includes it. I have a open point to know if the
> committee is interested in. As we don't have yet optional<T&> I believed
> that it could be done later on. However variant supports references, isn't
> it?
>
> Vicente
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


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