Boost logo

Boost :

Subject: Re: [boost] [optional] Thoughts on disallowing assignment for wrapped references.
From: Nevin Liber (nevin_at_[hidden])
Date: 2011-09-06 15:16:20


On 6 September 2011 04:57, Mostafa <mostafa_working_away_at_[hidden]> wrote:
>> 'ot = u' deals with the existence of the underlying object, while '*ot
>> = v' deals with the value of the underlying object.  Now, in C++,
>> there is no such thing as existence without value, so you cannot
>> escape dealing with the underlying value in the expression 'ot = u'.
>> That holds for non-reference types as well as for references.
>
> The Boost.Optional documentation begs to differ, direct quote:
>
> "Rebinding semantics for the assignment of initialized optional references
> has been chosen to provide consistency among initialization states even at
> the expense of lack of consistency with the semantics of bare C++
> references."

I was looking at it that the "value" of a reference is the object it
refers to, and not the value of that object itself. Sorry for not
being clear.

-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404

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