C++ Standard Library headers
The interface of C++ standard library is defined by the following collection of headers.
Contents
- 1 Multi-purpose headers
- 2 Language support library
- 3 Concepts library
- 4 Diagnostics library
- 5 Memory management library
- 6 Metaprogramming library
- 7 General utilities library
- 8 Containers library
- 9 Iterators library
- 10 Ranges library
- 11 Algorithms library
- 12 Strings library
- 13 Text processing library
- 14 Numerics library
- 15 Time library
- 16 Input/output library
- 17 Concurrency support library
- 18 C compatibility headers
- 19 Experimental libraries
- 20 See also
Multi-purpose headers
Language support library
Concepts library
Diagnostics library
Memory management library
Metaprogramming library
General utilities library
Containers library
Iterators library
Ranges library
Algorithms library
Strings library
Text processing library
Numerics library
Time library
Input/output library
Concurrency support library
[edit] 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). The intended use of headers of form xxx.h
is for interoperability only. It is possible that C++ source files need to include one of these headers in order to be valid ISO C. Source files that are not intended to also be valid ISO C should not use any of the C headers.
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.
Notes: xxx.h
headers are deprecated in C++98 and undeprecated in C++23. These headers are discouraged for pure C++ code, but not subject to future removal.
except for names of mathematical special functions [edit]
except for names of
std::byte
and related functions [edit]
[edit] Special C compatibility headers
The headers <stdatomic.h>, <stdbit.h>, and <stdckdint.h> declare names which are also provided in the C standard library. The header <stdatomic.h> also defines the _Atomic macro which is a keyword in C. Unlike other <xxx.h>
headers, corresponding <cstdatomic>
, <cstdbit>
, and <cstdckdint>
are not provided.
[edit] 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.
[edit] 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++.
__alignas_is_defined
and __alignof_is_defined
[edit]
__bool_true_false_are_defined
[edit]
[edit] Unsupported C headers
The C headers <stdatomic.h>,(until C++23) <stdnoreturn.h>, and <threads.h> are not included in C++ and have no cxxx
equivalents.
[edit] Experimental libraries
C++ TR's/TS's also define several collections of headers.