Understanding how to use essential STL containers
In this section, we will put our C++ skills to the test by decoding various STL container classes. We will see that language features we have mastered, from core C++ syntax to OOP skills, have put us in a position to easily interpret the various components of STL we will now examine. Most notably, we will put our knowledge of templates to use! Our knowledge of encapsulation and inheritance, for example, will guide us to understand how to use various methods in STL classes. However, we will notice that virtual functions and abstract classes are extremely rare in the STL. The best way to gain competence with a new class within the STL will be to embrace the documentation detailing each class. With knowledge of C++, we can easily navigate through a given class to decode how to use it successfully.
The container classes in the C++ STL implement various Abstract Data Types (ADTs) by encapsulating the data structures that implement these...