
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
Library in C++ STL?
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.
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.
Templates are a feature of the C++ programming language that allows functions and classes to operate with generic types. This allows a function or class to work on many different data types without being rewritten for each one
C++ Standard Template Library has following three well-structured components −
1 Containers
Containers are used to manage collections of objects of a certain kind. There are several different types of containers like deque, list, vector, map, etc.
Sequence Containers - These containers implement data structures which can be accessed in a sequential manner.
- vector
- list
- deque
- arrays
- forward_list
Container Adaptors - They provide a different interface for sequential containers.
- queue
- priority_queue
- stack
Associative Containers - They implement sorted data structures that can be quickly searched (O(log n) complexity).
- set
- multiset
- map
- multimap
Unordered Associative Containers - These containers implement unordered data structures that can be quickly searched
- unordered_set
- unordered_multiset
- unordered_map
- unordered_multimap
2 Algorithms
Algorithms act on containers. They provide the means by which you will perform initialization, sorting, searching, and transforming the contents of containers.
Algorithm
- Sorting
- Searching
- Important STL Algorithms
- Useful Array algorithms
- Partition Operations
3 Iterators
Iterators are used to step through the elements of collections of objects. These collections may be containers or subsets of containers.
- Related Articles
- Multiset in C++ Standard Template Library (STL)
- Pair in C++ Standard Template Library (STL)
- Sort in C++ Standard Template Library (STL)
- The C++ Standard Template Library (STL)
- Binary Search in C++ Standard Template Library (STL)
- Priority Queue in C++ Standard Template Library (STL)
- What's the difference between "STL" and "C++ Standard Library"?
- Chrono library in C++
- Containers in C++ STL
- count_if() in C++ STL
- stable_sort() in C++ STL
- deque_resize( ) in C++ in STL
- deque_rbegin( ) in C++ in STL
- deque_rend( ) in C++ in STL
- deque_insert( ) in C++ in STL
