October 2004
Intermediate to advanced
240 pages
6h 22m
English
push_back to other ways of expanding a sequencepush_back all you can: If you don’t need to care about the insert position, prefer using push_back to add an element to sequence. Other means can be both vastly slower and less clear.
You can insert elements into sequences at different points using insert, and you can append elements to sequences in various ways including:

Of all forms, push_back alone takes amortized constant time. The other forms’ performance can be as bad as quadratic. Needless to say, beyond small data volumes that makes those alternatives potential scalability barriers. (See Item 7.)
push_back ...