What is stl?
STL is the abbreviation of Standard Template Library, the Chinese name is Standard Template Library, and is the collective name for a series of software developed by HP Labs. It was developed by Alexander Stepanov, Meng Lee, and David R Musser while working at HP Labs.
Fundamentally speaking, STL is a collection of "containers", such as list, vector, set, map, etc. STL is also a collection of algorithms and other components. The collection of "containers" and algorithms here refers to the masterpieces of many smart people in the world over many years. The purpose of STL is to standardize components so that they do not need to be redeveloped and ready-made components can be used. STL is part of C, so no additional libraries need to be installed.
There are many versions of STL, common ones include HP STL, PJ STL, SGI STL, etc.
In the C standard, STL is organized into the following 13 header files:
Components
STL is a kind of generic programming. Object-oriented programming focuses on the data aspect of programming, while generic programming focuses on algorithms. What they have in common is abstraction and creating reusable code, but their philosophies are very different.
STL can be divided into six parts: containers, iterators, allocators, adapters, algorithms, and functors.
The above is the detailed content of what is stl. For more information, please follow other related articles on the PHP Chinese website!