
Speaking as a rank amateur (relative to everyone else posting about this), the last few postings seem to me to be heading in a more promising direction than the stark "rebind/no-rebind" debate. David Abrahams wrote:
Anthony Williams <anthony_w.geo@yahoo.com> writes:
How's this for a radical thought --- optional<T> should not be assignable from T. That way, it doesn't matter whether T is a reference, or not.
There's at least some precedent for types that are "immutable except for copy assignment."
The assignment from T is really a kind of mutating operation.
Instead, to change the binding, use reset(), and to assign use *.
To make that valid for a null optional, I think operator* would have to return a proxy reference... which is not an altogether bad idea, IMO.