C++ Standard Library
The C++ standard library includes a set of header files that provide various functions and tools, covering input/output, containers, algorithms, multithreading, regular expressions, and more.
The C++ standard library can be divided into two parts:
- Standard Function Library:This library is composed of general, standalone functions that do not belong to any class. The function library is inherited from the C language.
- Object-Oriented Class Library:This library is a collection of classes and their related functions.
The C++ standard library includes the entire C standard library, with certain additions and modifications made to support type safety.
The following is a list of the main component categories of the C++ standard library and their corresponding header files:
Input/Output
<iostream>: Standard input/output stream<fstream>: File input/output stream<sstream>: String stream<iomanip>: Input/output stream formatting
Container
<array>: Fixed-length array container<vector>: Dynamic array container<deque>: Double-ended queue container<list>: Doubly linked list container<forward_list>: Singly linked list container<stack>: Stack container adapter<queue>: Queue container adapter<priority_queue>: Priority queue container adapter<set>: Set container (based on a balanced binary tree)<unordered_set>: Unordered set container (based on a hash table)<map>: Map container (key-value pairs, based on a balanced binary tree)<unordered_map>: Unordered map container (based on a hash table)<bitset>: Bitset container
Algorithms and iterators
<algorithm>: Common algorithms (such as sorting, searching, etc.)<iterator>: Iterator
Function objects and bindings
<functional>: Defines function objects and related utilities
Mathematical and numerical operations
<numeric>: Numeric operations (such as accumulation, product, etc.)<complex>: Complex number operations<valarray>: Array classes and related operations<cmath>: Mathematical functions
Strings and regular expressions
Time and Date
Multithreading and concurrency
<thread>: Multithreading support<mutex>: Mutex<condition_variable>: Condition variables<future>: Asynchronous programming support<atomic>: Atomic operations
Memory Management
Type traits and runtime type identification
<type_traits>: Type traits<typeinfo>: Runtime type identification
Exception Handling
<exception>: Exception handling base classes and related utilities<stdexcept>: Common exception classes (such asstd::runtime_erroretc.)
Input/output operations
Other Tools
<utility>: General utilities (such asstd::pairandstd::moveetc.)<random>: Random number generation<locale>: Localization support<codecvt>: Character encoding conversion<cassert>: Assertion<cctype>: Character handling<cstring>: String handling<cwchar>: Wide character handling<climits>: Numeric limits<cfloat>: Floating-point limits<cstdlib>: Common utilities (such asstd::randandstd::absetc.)
These header files form the foundation of the C++ standard library, providing rich functionality to support developers in various types of programming tasks.
other extensions