The STL is way to simplify and speed up your development in any C++ program. Standard templates library contains powerful algorithm, a set of functions and many useful tools for any C++ developer. The components are algorithm, containers, functions and iterators. Algorithms and functions in STL work with containers of built-in type or your own custom containers.
Containers in STL C++
Containers are the same as in case of the physical world. You can store the something in the container. In this case, containers simplify manipulation and storing of a different type of information. Every container in real life has a different way to organize an order of stored objects(data).
vector in C++
By default, the vector allocates the memory on the heap, where the elements are stored. The great this is that the memory after vector is cleen up when it goes out of scope. In this case the descructor is triggered and heap is cleaned.