Boost logo

Boost :

From: Glen Knowles (gknowles_at_[hidden])
Date: 2003-02-18 22:29:44


From: David Abrahams [mailto:dave_at_[hidden]]
>> Extract is confusing. One problem is that it is deceivingly named.
>
>The name was my suggestion, so I'm going to argue with you a bit about
>that.
>
>> It doesn't extract data from the variant at all, but rather provides
>> type-specific access to data that still resides in the variant.
>
>"Provides type-specific access to data that still resides in the
>variant" is a mouthful, but I'm still not sure what it means. How is
>it different from extracting the data?

>> It is not clear from the name or the documentation that this would
>> be bad:
>>
>> variant<int>* v = new variant<int>; extract<int> i(*v); delete v;
>> return i;
>
>Ugh. Is it clear from the name that this would be bad?
>
>std::back_insert_iterator<std::vector<int> > f()
>{
> vector<int> v;
> return back_inserter(v);
>}

Yes, because here you have an inserter, which depends on what it
inserts data into. An extract on the other hand can usually exist
on its own.

I may be missing something, but as long as its just a proxy that offers
a type specific view of the data shouldn't it be called a view or a
proxy?

Glen



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