
"Fernando Cacciola" <fernando_cacciola@hotmail.com> writes:
"David Abrahams" <dave@boost-consulting.com> escribió en el mensaje news:uzmxnnzi1.fsf@boost-consulting.com...
"Fernando Cacciola" <fernando_cacciola@hotmail.com> 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