Boost logo

Boost :

Subject: Re: [boost] [mpl][docs]why use list?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2009-03-29 14:10:39

On 03/27/09 10:43, Steven Watanabe wrote:
> Larry Evans wrote:
>> After viewing the code some more, I'm wondering if the memoization is
>> not also possible with vectors with identical tails.
>> So, maybe list has an advantage for identical tails but vector has an
>> advantage for identical heads?
> No. Take a look at how the iterators for vector work.
> template<
> typename Vector
> >
> struct v_iter;
> Iterators into different vectors are always distinct.

Ah! Thanks.

Now, on a related matter,

what's the rationale for vector0::lower_bound_::value == 32768

as shown here:

and what's the rationale for at_front=0 here:

The only reason, AFAICT, for the at_front value is that the vectorI
specializations here:

for some reason add items starting from the tail, as shown at:

However, if the items were added from the head, then at_front=1 could
be used. The reason that would be desirable is that it enables the
variadic template compiler to used to simplify the mpl::vector
implementation, as shown here:

The reason I'd like to know the vector0::lower_bound_::value rationale
is I'd like to add that to the in source documentation. However, as
you can see from looking at the current mpl/vector/aux_/vector0.hpp
source file, I can't figure out a good reason for 32768.

Thanks very much for your help, Steven.


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