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

Container

Algorithms and iterators

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

Memory Management

  • <memory>: Smart pointers and dynamic memory management
  • <new>: Dynamic memory allocation

Type traits and 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