Boost logo

Boost :

From: Deane Yang (deane_yang_at_[hidden])
Date: 2005-10-18 12:54:17


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_at_[hidden]> 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.
>


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