Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

You're browsing the C++ documentation.

To browse all docs, go


to devdocs.io (or press esc).

DevDocs
PreferencesOffline DataChangelogGuideAboutReport a bug
C++
240Algorithm1Atomic operations6Compiler support33Concepts359Concurrency
support9Constrained algorithms557Containers68Diagnostics91Dynamic memory
management1Feature
testing160Filesystem428Input/output167Iterator96Keywords195Language196Localizatio
ns131Metaprogramming75Named requirements677Numerics287Ranges80Regular
expressions112Standard library headers243Strings19Symbol index945Utilities6Versions
C++ Programming Language
The interface of C++ standard library is defined by the following collection of
headers.

Concepts library
<concepts> Fundamental library concepts
(C++20)
Coroutines library
<coroutine> Coroutine support library
(C++20)
Utilities library
<any> std::any class
(C++17)
<bitset> std::bitset class template
<chrono> C++ time utilites
(C++11)
<compare> Three-way comparison operator support
(C++20)
<csetjmp> Macro (and function) that saves (and jumps) to an execution
context
<csignal> Functions and macro constants for signal management
<cstdarg> Handling of variable length argument lists
<cstddef> Standard macros and typedefs
<cstdlib> General purpose utilities: program control, dynamic memory
allocation, random numbers, sort and search
<ctime> C-style time/date utilites
<expected> std::expected class template
(C++23)
<functional> Function objects, Function invocations, Bind operations and
Reference wrappers
<initializer_list> std::initializer_list class template
(C++11)
<optional> std::optional class template
(C++17)
<source_location> Supplies means to obtain source code location
(C++20)
<tuple> std::tuple class template
(C++11)
<type_traits> Compile-time type information
(C++11)
<typeindex> std::type_index
(C++11)
<typeinfo> Runtime type information utilities
<utility> Various utility components
<variant> std::variant class template
(C++17)
<version> Supplies implementation-dependent library information
(C++20)
Dynamic memory management
<memory> High-level memory management utilities
<memory_resource Polymorphic allocators and memory resources
>
(C++17)
<new> Low-level memory management utilities
<scoped_allocator> Nested allocator class
(C++11)
Numeric limits
<cfloat> Limits of floating-point types
<cinttypes> Formatting macros, intmax_t and uintmax_t math and conversions
(C++11)
<climits> Limits of integral types
<cstdint> Fixed-width integer types and limits of other types
(C++11)
<limits> Uniform way to query properties of arithmetic types
<stdfloat> Optional extended floating-point types
(C++23)
Error handling
<cassert> Conditionally compiled macro that compares its argument to zero
<cerrno> Macro containing the last error number
<exception> Exception handling utilities
<stacktrace> Stacktrace library
(C++23)
<stdexcept> Standard exception objects
<system_error> Defines std::error_code, a platform-dependent error code
(C++11)
Strings library
<cctype> Functions to determine the category of narrow characters
<charconv> std::to_chars and std::from_chars
(C++17)
<cstring> Various narrow character string handling functions
<cuchar> C-style Unicode character conversion functions
(C++11)
<cwchar> Various wide and multibyte string handling functions
<cwctype> Functions to determine the catagory of wide characters
<format> Formatting library including std::format
(C++20)
<string> std::basic_string class template
<string_view> std::basic_string_view class template
(C++17)
Containers library
<array> std::array container
(C++11)
<deque> std::deque container
<flat_map> std::flat_map and std::flat_multimap container adaptors
(C++23)
<flat_set> std::flat_set and std::flat_multiset container adaptors
(C++23)
<forward_list> std::forward_list container
(C++11)
<list> std::list container
<map> std::map and std::multimap associative containers
<mdspan> std::mdspan view
(C++23)
<queue> std::queue and std::priority_queue container adaptors
<set> std::set and std::multiset associative containers
<span> std::span view
(C++20)
<stack> std::stack container adaptor
<unordered_map> std::unordered_map and std::unordered_multimap unordered
(C++11) associative containers
<unordered_set> std::unordered_set and std::unordered_multiset unordered associative
(C++11) containers
<vector> std::vector container
Iterators library
<iterator> Range iterators
Ranges library
<generator> std::generator class template
(C++23)
<ranges> Range access, primitives, requirements, utilities and adaptors
(C++20)
Algorithms library
<algorithm> Algorithms that operate on ranges
<execution> Predefined execution policies for parallel versions of the algorithms
(C++17)
Numerics library
<bit> Bit manipulation functions
(C++20)
<cfenv> Floating-point environment access functions
(C++11)
<cmath> Common mathematics functions
<complex> Complex number type
<numbers> Math constants
(C++20)
<numeric> Numeric operations on values in ranges
<random> Random number generators and distributions
(C++11)
<ratio> Compile-time rational arithmetic
(C++11)
<valarray> Class for representing and manipulating arrays of values
Localization library
<clocale> C localization utilities
<codecvt> Unicode conversion facilities
(C++11)(deprecate
d in C++17)
<locale> Localization utilities
Input/output library
<cstdio> C-style input-output functions
<fstream> std::basic_fstream, std::basic_ifstream, std::basic_ofstream class
templates and several typedefs
<iomanip> Helper functions to control the format of input and output
<ios> std::ios_base class, std::basic_ios class template and several typedefs
<iosfwd> Forward declarations of all classes in the input/output library
<iostream> Several standard stream objects
<istream> std::basic_istream class template and several typedefs
<ostream> std::basic_ostream, std::basic_iostream class templates and several
typedefs
<print> Formatted output library including std::print
(C++23)
<spanstream> std::basic_spanstream, std::basic_ispanstream, std::basic_ospanstream cla
(C++23) ss templates and typedefs
<sstream> std::basic_stringstream, std::basic_istringstream, std::basic_ostringstream
class templates and several typedefs
<streambuf> std::basic_streambuf class template
<strstream> std::strstream, std::istrstream, std::ostrstream
(deprecated in
C++98)
<syncstream> std::basic_osyncstream, std::basic_syncbuf, and typedefs
(C++20)
Filesystem library
<filesystem> std::path class and supporting functions
(C++17)
Regular Expressions library
<regex> Classes, algorithms and iterators to support regular expression
(C++11) processing
Atomic Operations library
<atomic> Atomic operations library
(C++11)
Thread support library
<barrier> Barriers
(C++20)
<condition_variabl Thread waiting conditions
e>
(C++11)
<future> Primitives for asynchronous computations
(C++11)
<latch> Latches
(C++20)
<mutex> Mutual exclusion primitives
(C++11)
<semaphore> Semaphores
(C++20)
<shared_mutex> Shared mutual exclusion primitives
(C++14)
<stop_token> Stop tokens for std::jthread
(C++20)
<thread> std::thread class and supporting functions
(C++11)

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.
Behaves same as <cassert>
<assert.h>

<ctype.h> Behaves as if each name from <cctype> is placed in global namespace


<errno.h> Behaves same as <cerrno>
<fenv.h> Behaves as if each name from <cfenv> is placed in global namespace
(C++11)
<float.h> Behaves same as <cfloat>
<inttypes.h> Behaves as if each name from <cinttypes> is placed in global namespace
(C++11)
<limits.h> Behaves same as <climits>
<locale.h> Behaves as if each name from <clocale> is placed in global namespace
<math.h> Behaves as if each name from <cmath> is placed in global namespace,
except for names of mathematical special functions
<setjmp.h> Behaves as if each name from <csetjmp> is placed in global namespace
<signal.h> Behaves as if each name from <csignal> is placed in global namespace
<stdarg.h> Behaves as if each name from <cstdarg> is placed in global namespace
<stddef.h> Behaves as if each name from <cstddef> is placed in global namespace,
except for names of std::byte and related functions
<stdint.h> Behaves as if each name from <cstdint> is placed in global namespace
(C++11)
<stdio.h> Behaves as if each name from <cstdio> is placed in global namespace
<stdlib.h> Behaves as if each name from <cstdlib> is placed in global namespace
<string.h> Behaves as if each name from <cstring> is placed in global namespace
<time.h> Behaves as if each name from <ctime> is placed in global namespace
<uchar.h> Behaves as if each name from <cuchar> is placed in global namespace
(C++11)
<wchar.h> Behaves as if each name from <cwchar> is placed in global namespace
<wctype.h> Behaves as if each name from <cwctype> is placed in global namespace

Special C compatibility headers

The header <stdatomic.h> declares names which are also provided in the C
standard library, and defines the _Atomic macro which is a keyword in C. Unlike
other xxx.h headers, corresponding <cstdatomic> is not provided.
Defines _Atomic and provides corresponding components in the C
<stdatomic.h> standard library

(C++23)

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

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++.
Empty header. The macros that appear
<ciso646> in iso646.h in C are keywords in C++

(removed in C++20)
<cstdalign> Defines one compatibility macro constant
(C++11)(deprecated in
C++17)(removed in C++20)
<cstdbool> Defines one compatibility macro constant
(C++11)(deprecated in
C++17)(removed in C++20)
<iso646.h> Has no effect
<stdalign.h> Defines one compatibility macro constant
(C++11)
<stdbool.h> Defines one compatibility macro constant
(C++11)

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.

Experimental libraries

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


See also

C documentation for C Standard Library headers

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License
v3.0.
https://en.cppreference.com/w/cpp/header

You might also like