Possible Duplicate:
Why would I prefer using vector to deque
I am curious why is it that std::vector
is so much more popular than std::deque
. Deque is almost as efficient in lookup, more efficient in insert (without vector::reserve)and allows for inserting/deleting in the front.
Herb Sutter once recommended that if you want to use vector, just prefer deque (I am paraphrasing). However in a recent talk on Writing Modern C++ he again strongly recommends thinking of std::vector
as a default container. According to the GOTW I linked earlier, even the standard has similar wording.
Is there a reason for this disparity? Is it just that vector
is simpler and more well known, or is there a technical reason? Or is it that vector
is just a cooler name .. ?