Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-03-01 13:19:53


"Fernando Cacciola" <fernando_cacciola_at_[hidden]> writes:

> "David Abrahams" <dave_at_[hidden]> escribió en el mensaje
> news:uzmxnnzi1.fsf_at_boost-consulting.com...
>> "Fernando Cacciola" <fernando_cacciola_at_[hidden]> writes:
>>
>>> [SNIP]
>>>
>>> If I change the code now to use T's operator=(), assignment of
>>> optional<T&>
>>> will have a _radically_ different semantics. A correct one, that's for
>>> sure,
>>> but end user code might be fundamentally impacted.
>>
>> You might want to consider whether it makes sense to change the
>> semantics only for non-reference types.
>>
> Yes, I considered that.. the problem I have is that I really don't like
> Optional rebinding references upon assignment... its ideal principle is to
> do exactly as the wrapped type does and differ only when uninitialized cases
> are involved.

It depends on whether you view optional<T> as a T that might just
happen to be missing, or as a container for a T.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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