Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2003-08-31 20:56:24

On Mon, Sep 01, 2003 at 09:03:17AM +0800, Joel de Guzman wrote:
> Do it the ref, tuple and variant way: get(). But get(), as an
> element-access interface, should return a reference, not a pointer, as
> it does currently.

Clearly I had not been paying enough attention earlier in the thread; I
was oblivious to the fact that get() was returning a pointer and not a
reference. I think get() (or operator*(), or however it ends up being
spelled) should indeed return a reference.

(Apologies for the confusion.)

As for the use-case with the function returning a pair of iterators
that we'd like to assign to optionals via a tie(), I think there
should also be a different method in the interface which returns the
"hole" in an empty optional where a new value can be constructed. See,
e.g., my earlier message which defined an interface with operator+()
and operator~().

-Brian McNamara (lorgon_at_[hidden])

Boost list run by bdawes at, gregod at, cpdaniel at, john at