Boost logo

Boost :

From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2005-10-24 12:35:46


Rob Stewart wrote:
>
> Yes, an interface for non-assignable types that doesn't requiring
> parameterizing optional would be good. IOW, o.rebind(rb) rather
> than o = optional<T&>(rb).
>
Right.

make_optional(v) doesn't work because it can't tell whether we want a T or a
T&

optional_tie() would work but it requires the user to know wheter T or T& is
needed.

direct assignment is troublesome.

So the only choices I see are:

o.rebind(rb)

or

o = optional<T&>(rb).

And I think I like the rebind() better.

-- 
Fernando Cacciola
SciSoft
http://fcacciola.50webs.com/

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