October 2004
Intermediate to advanced
240 pages
6h 22m
English
vector by default. Otherwise, choose an appropriate containerUsing the “right container” is great: If you have a good reason to use a specific container type, use that container type knowing that you did the right thing.
So is using vector: Otherwise, write vector and keep going without breaking stride, also knowing you did the right thing.
Here are three fundamental issues and related questions for programming in general, and for choosing a container in particular:
• Write for correctness, simplicity, and clarity first (see Item 6):Prefer to choose the container that will let you write the clearest code. Examples: If you need to insert at a specific position, use a sequence container (e.g., vector, list). If you ...