
18 Oct
2005
18 Oct
'05
3:52 p.m.
Hi, Rob Stewart wrote:
An optional<T&> should optionally contain a reference to T. Either optional<T&> has a T& or it doesn't. Since T& cannot be rebound, neither should optional<T&>'s T& be rebound by assignment from another T&. That said, assigning from none restores the optional<T&> to (the equivalent of) its default constructed state, so it can bind to a new T&.
I agree on that one. If the developer wanted a pointer, he'd have asked for it. Simon