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
>> "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

Boost list run by bdawes at, gregod at, cpdaniel at, john at