Skip to content
Related Articles

Related Articles

The C++ Standard Template Library (STL)

View Discussion
Improve Article
Save Article
  • Difficulty Level :Easy
  • Last Updated :15 Jul, 2022
View Discussion
Improve Article
Save Article

The Standard Template Library (STL) is a set of C++ template classes to provide common programming data structures and functions such as lists, stacks, arrays, etc. 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. 

STL has 4 components:

  • Algorithms
  • Containers
  • Functions
  • Iterators

Algorithms

The header algorithm defines a collection of functions specially designed to be used on a range of elements. They act on containers and provide means for various operations for the contents of the containers.

Containers

Containers or container classes store objects and data. There are in total seven standards “first-class” container classes and three container adaptor classes and only seven header files that provide access to these containers or container adaptors.

 


 

Functions

The STL includes classes that overload the function call operator. Instances of such classes are called function objects or functors. Functors allow the working of the associated function to be customized with the help of parameters to be passed.

Iterators

As the name suggests, iterators are used for working upon a sequence of values. They are the major feature that allows generality in STL.

Utility Library

Defined in header <utility>.

To master C++ Standard Template Library (STL) in the most efficient and effective way, do check out this C++ STL Online Course by GeeksforGeeks. The course covers the basics of C++ and in-depth explanations to all C++ STL containers, iterators, etc along with video explanations of a few problems. Also, you’ll learn to use STL inbuilt classes and functions in order to implement some of the complex data structures and perform operations on them conveniently.

Recent Articles on STL!

Please write comments if you find anything incorrect, or if you want to share more information about the topic discussed above.

My Personal Notesarrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!