Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
If you know you’re adding a range, even at the end of a container, prefer to use a range insertion function (see Item 81).
Exponential growth is generous with memory allocation. To fine-tune growth, call reserve explicitly—push_back, resize, and the like never trigger reallocation if they have enough space. To “right-size” a vector, use the shrink-to-fit idiom (see Item 82).