9.3.1. Adding Elements to a Sequential Container

Image

Excepting array, all of the library containers provide flexible memory management. We can add or remove elements dynamically changing the size of the container at run time. Table 9.5 (p. 343) lists the operations that add elements to a (nonarray) sequential container.

Table 9.5. Operations That Add Elements to a Sequential Container

Image

When we use these operations, we must remember that the containers use different strategies for allocating elements and that these strategies affect performance. Adding ...

Get C++ Primer, Fifth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.