The C++ STL (Standard Template Library) is a powerful set of C++ template classes to provide general-purpose classes and functions with templates that implement many popular and commonly used algorithms and data structures like vectors, lists, queues, and stacks.
It is a library of container classes, algorithms, and iterators. It is a generalized library and so, its components are parameterized. Working knowledge of template classes is a prerequisite for working with STL.
Templates are a feature of the C++ programming language that allows functions and classes to operate with generic types. This allows a function or class to work on many different data types without being rewritten for each one
C++ Standard Template Library has following three well-structured components −
Containers are used to manage collections of objects of a certain kind. There are several different types of containers like deque, list, vector, map, etc.
Sequence Containers - These containers implement data structures which can be accessed in a sequential manner.
Container Adaptors - They provide a different interface for sequential containers.
Associative Containers - They implement sorted data structures that can be quickly searched (O(log n) complexity).
Unordered Associative Containers - These containers implement unordered data structures that can be quickly searched
Algorithms act on containers. They provide the means by which you will perform initialization, sorting, searching, and transforming the contents of containers.
Iterators are used to step through the elements of collections of objects. These collections may be containers or subsets of containers.