Components
In this lesson, we'll examine the three basic elements which make C++ functional.
The three components of the STL are:
The Standard Template Library (STL) consists of three components from a bird’s-eye view. Those are containers, algorithms that run on the containers, and iterators that connect both of them. This abstraction of generic programming enables you to combine algorithms and containers uniquely. The containers have only minimal requirements for their elements.
Containers
The C++ Standard Library has a rich collection of containers. From a bird’s eye, we have sequential and associative containers. Associative containers can be classified as ordered or unordered associate containers.
Sequential Containers
Each of the sequential containers has a unique domain, but in 95% of the use cases std::vector
is the right choice. std::vector
can dynamically adjust its size, automatically manages its memory and provides you with outstanding performance. In contrast, std::array
is the only sequential container that cannot ...