Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-04-16 10:23:06


Dill, John wrote:
>> So e.g. list1 is always instantiated with a reference type,
>
> to what? the original type, or the add_value processed type?
>
>> and thus it also stores the arguments as references.
>
> I still think that those types are processed by add_value before
> being used. The bind_t L template parameter is instantiated with a
> list of add_value modified types through list_av_N in the bind calls,
> which leads me to believe that the listN represented by l_ object in
> bind_t has types of either value<T>, reference_wrapper<T>, or other
> bind_t structures. So are the types stored in listN (A1, A2, ... )
> ever the original type or the original reference type? Or are they
> always add_value<T> processed?

The types in l_ are always add_value processed, the types in the other listN
that stores references to the arguments at the call site are not. In

    bind(f, a1, a2)(b1, b2);

bind(f, a1, a2) creates a list2 that holds the values of a1 and a2,
add_value-processed. The call (b1, b2) creates a list2<B1&, B2&> that holds
references to b1 and b2.

These are all implementation details. I don't see why you seem so worried
about them. In particular, add_value is only present because of the need to
support MSVC 6. On a compiler that supports partial specialization, it's
possible to use an unadorned list2<A1, A2> as l_. Many other implementation
variations are also possible.


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