glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] question about std::list


From: Bradley Arsenault
Subject: Re: [glob2-devel] question about std::list
Date: Sat, 5 May 2007 17:48:41 -0400

vector is better when you need random access, and are adding/removing
relativly few times. A memory conservative implementation has to
reallocate for every add/remove, which can get costly quickly. Most
optimized implementations allocate more than nesseccarry, for this
reason. Thats also why they have std::vector::reserve.

queue is based on a different container (provided as a template
argument, defaults usually to std::list) so is no better than using
std::list or std::deque. Its more of a facade.

list is probably the best when you add/remove allot but only iterate
in forward/backward direction.


--
Really. I'm not lieing. Bradley Arsenault.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]