Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-02-19 09:04:25


"Peter Dimov" <pdimov_at_[hidden]> writes:

> Joel de Guzman wrote:
>> David Abrahams wrote:
>>
>>> BTW, I just realized that a conversion from variant<T> to optional<T>
>>> could be used to do extraction as well. Maybe it would be better to
>>> ditch extract altogether and just use optional?
>>
>> I think this makes sense. The disadvantage is the overhead of optional
>> just to do "extract"ion.
>
> That means an extra copy

Really? You can't convert to an optional<T&>?

> and inability to change that data held in the variant using
> non-const extract.

Same question applies.

> If we really need to go that route, it's probably better to just
> make extract return a value.

I'm confused.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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