Boost logo

Boost :

Subject: Re: [boost] [mpl][docs]why use list?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-03-21 12:31:54


AMDG

Larry Evans wrote:
> Comparing the vector doc:
>
> http://www.boost.org/doc/libs/1_38_0/libs/mpl/doc/refmanual/vector.html
>
> which contains:
>
> supports constant-time insertion and removal of elements at both ends,
> and linear-time insertion and removal of elements in the middle.
>
> with the list doc:
>
> http://www.boost.org/doc/libs/1_38_0/libs/mpl/doc/refmanual/list.html
>
> which contains:
>
> supports constant-time insertion and removal of elements at the
> beginning, and linear-time insertion and removal of elements at the
> end and in the middle.
>
> shows these documents indicate no reason to prefer list over vector
> but does indicate a reason to prefer vector over list.
> Is there any reason to prefer list over of vector?

Usually vector is better. The maximum size of a vector is 50
on compilers that don't support typeof. 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.

In Christ,
Steven Watanabe


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