C++ Standard Library headers

From cppreference.com
< cpp
 
 
 

The interface of C++ standard library is defined by the following collection of headers.

Concepts library

Fundamental library concepts

Coroutines library

Coroutine support library

Utilities library

General purpose utilities: program control, dynamic memory allocation, random numbers, sort and search
Functions and macro constants for signal management
Macro (and function) that saves (and jumps) to an execution context
Handling of variable length argument lists
Runtime type information utilities
std::type_index
Compile-time type information
std::bitset class template
Function objects, Function invocations, Bind operations and Reference wrappers
Various utility components
C-style time/date utilites
(C++11)
C++ time utilites
Standard macros and typedefs
std::initializer_list class template
(C++11)
std::tuple class template
(C++17)
std::any class
std::optional class template
(C++17)
std::variant class template
(C++20)
Three-way comparison operator support
(C++20)
Supplies implementation-dependent library information
Supplies means to obtain source code location
Dynamic memory management
Low-level memory management utilities
High-level memory management utilities
Nested allocator class
Polymorphic allocators and memory resources
Numeric limits
Limits of integral types
Limits of floating-point types
(C++11)
Fixed-width integer types and limits of other types
Formatting macros, intmax_t and uintmax_t math and conversions
Uniform way to query properties of arithmetic types
Error handling
Exception handling utilities
Standard exception objects
Conditionally compiled macro that compares its argument to zero
Defines std::error_code, a platform-dependent error code
Macro containing the last error number

Strings library

Functions to determine the category of narrow characters
Functions to determine the catagory of wide characters
Various narrow character string handling functions
Various wide and multibyte string handling functions
(C++11)
C-style Unicode character conversion functions
std::basic_string class template
std::basic_string_view class template
std::to_chars and std::from_chars
(C++20)
Formatting library including std::format

Containers library

(C++11)
std::array container
std::vector container
std::deque container
std::list container
std::forward_list container
std::set and std::multiset associative containers
std::map and std::multimap associative containers
std::unordered_set and std::unordered_multiset unordered associative containers
std::unordered_map and std::unordered_multimap unordered associative containers
std::stack container adaptor
std::queue and std::priority_queue container adaptors
(C++20)
std::span view

Iterators library

Range iterators

Ranges library

(C++20)
Range access, primitives, requirements, utilities and adaptors

Algorithms library

Algorithms that operate on ranges
Predefined execution policies for parallel versions of the algorithms

Numerics library

Common mathematics functions
Complex number type
Class for representing and manipulating arrays of values
(C++11)
Random number generators and distributions
Numeric operations on values in ranges
(C++11)
Compile-time rational arithmetic
(C++11)
Floating-point environment access functions
(C++20)
Bit manipulation functions
(C++20)
Math constants

Localization library

Localization utilities
C localization utilities
(C++11)(deprecated in C++17)
Unicode conversion facilities

Input/output library

Forward declarations of all classes in the input/output library
std::ios_base class, std::basic_ios class template and several typedefs
std::basic_istream class template and several typedefs
std::basic_ostream, std::basic_iostream class templates and several typedefs
Several standard stream objects
std::basic_fstream, std::basic_ifstream, std::basic_ofstream class templates and several typedefs
std::basic_stringstream, std::basic_istringstream, std::basic_ostringstream class templates and several typedefs
std::basic_osyncstream, std::basic_syncbuf, and typedefs
(deprecated in C++98)
std::strstream, std::istrstream, std::ostrstream
Helper functions to control the format of input and output
std::basic_streambuf class template
C-style input-output functions

Filesystem library

std::path class and supporting functions

Regular Expressions library

(C++11)
Classes, algorithms and iterators to support regular expression processing

Atomic Operations library

(C++11)
Atomic operations library

Thread support library

(C++11)
std::thread class and supporting functions
Stop tokens for std::jthread
(C++11)
Mutual exclusion primitives
Shared mutual exclusion primitives
(C++11)
Primitives for asynchronous computations
Thread waiting conditions
Semaphores
(C++20)
Latches
(C++20)
Barriers

C compatibility headers

For some of the C standard library headers of the form xxx.h, the C++ standard library both includes an identically-named header and another header of the form cxxx (all meaningful cxxx headers are listed above).

With the exception of complex.h , each xxx.h header included in the C++ standard library places in the global namespace each name that the corresponding cxxx header would have placed in the std namespace.

These headers are allowed to also declare the same names in the std namespace, and the corresponding cxxx headers are allowed to also declare the same names in the global namespace: including <cstdlib> definitely provides std::malloc and may also provide ::malloc. Including <stdlib.h> definitely provides ::malloc and may also provide std::malloc. This applies even to functions and function overloads that are not part of C standard library.

(deprecated)
Behaves same as <cassert>
(deprecated)
Behaves as if each name from <cctype> is placed in global namespace
(deprecated)
Behaves same as <cerrno>
(C++11)(deprecated)
Behaves as if each name from <cfenv> is placed in global namespace
(deprecated)
Behaves same as <cfloat>
(C++11)(deprecated)
Behaves as if each name from <cinttypes> is placed in global namespace
(deprecated)
Behaves same as <climits>
(deprecated)
Behaves as if each name from <clocale> is placed in global namespace
(deprecated)
Behaves as if each name from <cmath> is placed in global namespace,
except for names of mathematical special functions
(deprecated)
Behaves as if each name from <csetjmp> is placed in global namespace
(deprecated)
Behaves as if each name from <csignal> is placed in global namespace
(deprecated)
Behaves as if each name from <cstdarg> is placed in global namespace
(deprecated)
Behaves as if each name from <cstddef> is placed in global namespace,
except for names of std::byte and related functions
(C++11)(deprecated)
Behaves as if each name from <cstdint> is placed in global namespace
(deprecated)
Behaves as if each name from <cstdio> is placed in global namespace
(deprecated)
Behaves as if each name from <cstdlib> is placed in global namespace
(deprecated)
Behaves as if each name from <cstring> is placed in global namespace
(deprecated)
Behaves as if each name from <ctime> is placed in global namespace
(C++11)(deprecated)
Behaves as if each name from <cuchar> is placed in global namespace
(deprecated)
Behaves as if each name from <cwchar> is placed in global namespace
(deprecated)
Behaves as if each name from <cwctype> is placed in global namespace

Empty C headers

The headers <complex.h>, <ccomplex>, <tgmath.h>, and <ctgmath> do not contain any content from the C standard library and instead merely include other headers from the C++ standard library. The use of all these headers is deprecated in C++.

(C++11)(deprecated in C++17)(removed in C++20)
Simply includes the header <complex>
(C++11)(deprecated)
Simply includes the header <complex>
(C++11)(deprecated in C++17)(removed in C++20)
Simply includes the headers <complex> and <cmath>: the overloads equivalent to the contents of the C header tgmath.h are already provided by those headers
(C++11)(deprecated)
Simply includes the headers <complex> and <cmath>

Meaningless C headers

The headers <ciso646>, <cstdalign>, and <cstdbool> are meaningless in C++ because the macros they provide in C are language keywords in C++.

(removed in C++20)
Empty header. The macros that appear in iso646.h in C are keywords in C++
(deprecated)
Has no effect
(C++11)(deprecated in C++17)(removed in C++20)
Defines one compatibility macro constant
(C++11)(deprecated)
Defines one compatibility macro constant
(C++11)(deprecated in C++17)(removed in C++20)
Defines one compatibility macro constant
(C++11)(deprecated)
Defines one compatibility macro constant

Unsupported C headers

The C headers <stdatomic.h>, <stdnoreturn.h>, and <threads.h> are not included in C++ and have no cxxx equivalents.

Experimental libraries

C++ TR's/TS's also define several collections of headers.

See also