Standard Template Library
| C++ Standard Library |
|---|
| Containers |
| C standard library |
| This article is part of a series on the C++ programming language |
The Standard Template Library (STL) was a software library originally designed by Alexander Stepanov for the C++ programming language that influenced many parts of the C++ Standard Library, though no longer is actively maintained and is now mostly integrated into the C++ standard library itself. It provides four components called algorithms, containers, functors, and iterators.
The STL provides a set of common classes for C++, such as containers and associative arrays, that can be used with any built-in type or user-defined type that supports some elementary operations (such as copying and assignment). STL algorithms are independent of containers, which significantly reduces the complexity of the library.
The STL achieves its results through the use of templates. This approach provides compile-time polymorphism that is often more efficient than traditional run-time polymorphism. Modern C++ compilers are tuned to minimize abstraction penalties arising from heavy use of the STL.
The STL was created as the first library of generic algorithms and data structures for C++, with four ideas in mind: generic programming, abstractness without loss of efficiency, the Von Neumann computation model, and value semantics.
The STL and the C++ Standard Library are two distinct entities, though sometimes the parts of the C++ Standard Library directly influenced/inherited from the STL are called "the STL".