views:

143

answers:

4

Do you just base your STL container selections on the following attributes?

  1. Searching/Updating
  2. Insertion and
  3. Deletion

If not, what else do you base your selections upon? Is there any reference out there that lists how each container performs across all these different attributes?

+4  A: 

Scott Meyers' Effective STL covers not only this, but the weird pitfalls that you'll run into with some of the odder containers like set.

Meredith L. Patterson
A: 

Guarantee that the data is placed in continuous memory can be important. Typically if you are interested in using the data in the structure with interfaces that looks like doSomething(int* data, int dataCount).

Laserallan
A: 

I start of by thinking about the "shape" of the data, how often each item can repeat etc.

Ian Ringrose
+2  A: 

+1 for effective STL.

But if you need an on-line reference, there is a good flowchart in StackOverflow Question 471432

Anton I. Sipos