Boost logo

Boost :

From: Brock Peabody (brock.peabody_at_[hidden])
Date: 2005-03-10 23:26:00


> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of Fernando Cacciola

...

> > I think "a container for a T" is a more manageable meaning for
> > optional<T>.
>
> Yet I need to weight the balance one way and I choosen to favor the
> wrapper
> view... much of the latest evolution goes in this way.
>

...

> >
> Well, I agree that optional<> is intended to give you something you don't
> get straight from the language, but as it is now, its goal is to offer you
> something more of an extension of what you already get than a replacement.
>
> Furthermore, you can get rebinding semantics via optional< ref<T> >.
>

Hi Fernando,

I don't know if you saw the rest of the discussion but I think that the
consensus was that rebinding should be disabled on optional<T&> as you
suggest, and along with it operator=. Optional<T&> would then only be
initialized via constructor (like T& itself), and optional<T&>::operator=
would be a compile time error rather than deferred to T::operator=. Does
this seem right to you?

Brock


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