Boost logo

Boost :

Subject: Re: [boost] [optional] Thoughts on disallowing assignment for wrapped references.
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2011-09-03 23:29:21


On Fri, 02 Sep 2011 11:10:01 -0700, Stewart, Robert
<Robert.Stewart_at_[hidden]> wrote:

> Mostafa wrote:
>> On Wed, 31 Aug 2011 22:13:30 -0700, Nevin Liber
>> <nevin_at_[hidden]> wrote:
>> > On 31 August 2011 16:13, Mostafa
>> > <mostafa_working_away_at_[hidden]> wrote:
>>
>> Ahh, I disagree with that. IMO, if maybereff was not bound at
>> construction time, then it should always remain
>> "uninitialized".
>
> If the only way to make a non-empty optional<T&> is to construct it from
> a reference, then it couldn't be used, for example, as a function return
> type.
>

A non-empty maybereff can be bound at construction time via construction
 from a T& or from construction from a non-empty optional<T&>. The latter
would allow it to be used as a function return type.

Mostafa


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