Create and Delete

Below, we examine the different methods available for constructing/destroying containers with particular parameters.

We'll cover the following...

You can construct each container by a multitude of constructors. To delete all elements of a container cont, you can use cont.clear(). It makes no difference if you create a container, if you delete them or if you add or remove elements. Each time the container takes care of the memory management.

The table shows you the constructors and destructors of a container. A ...