Standard Template Library (STL) in C++

Last Updated on 26 Dec 2021 by Satya Prakash Singh Rathour
5 mins read

Standard Template Library

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, etc  .

It has four components :-

  • Containers
  • Algorithms 
  • Functions
  • Iterators

 

Containers

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

Ex:-

   1. binary_search ( ),

    2. sort( )

    3 find ( )  all these all sample examples and there are 1000 of prebuilt functions are there in STL . 

Algorithms

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

 

...............to be continued

Category: Python | General Programming

Relavent Tags: C++