Boost logo

Boost :

Subject: Re: [boost] [mpl][docs]why use list?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2009-03-27 12:00:40

On 03/23/09 05:40, Larry Evans wrote:
> On 03/21/09 11:31, Steven Watanabe wrote:
> > Also, it is possible for memoization to reduce the number of
> > template instantiations when iterating over lists with identical
> > tails, iterators into distinct vectors always have different types.
> Thank you. This is what I needed to know. In summary.

Hi Steven,

After viewing the code some more, I'm wondering if the memoization is
not also possible with vectors with identical tails. That's because,


39 typename T0, typename T1, typename T2
40 >
41 struct vector3
42 : v_item<
43 T2
44 , vector2< T0,T1 >
45 >
46 {
47 typedef vector3 type;
48 };

it appears that vector would have a memoization advantage for idential
heads. For instance:

   vector<T0,T1,T2_1> vs vector<T0,T1,T2_2>

from the above vector3 code:

   v_item<T2_1,vector2<T0,T1> > vs v_item<T2_2,vector2<T0,T1> >

So, maybe list has an advantage for identical tails but vector has an
advantage for identical heads?


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