Professional Documents
Culture Documents
C++
Standard Library headers
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
General purpose utilities: program control, dynamic memory
<cstdlib>
allocation, random numbers, sort and search
<csetjmp> Macro (and function) that saves (and jumps) to an execution context
<typeindex>
std::type_index
(C++11)
<type_traits>
Compile-time type information
(C++11)
<chrono>
C++ time utilites
(C++11)
<initializer_list>
std::initializer_list class template
(C++11)
<any>
std::any class
(C++17)
<optional>
std::optional class template
(C++17)
<variant>
std::variant class template
(C++17)
<compare>
Three-way comparison operator support
(C++20)
<version>
Supplies implementation-dependent library information
(C++20)
<source_location>
Supplies means to obtain source code location
(C++20)
Dynamic memory management
<scoped_allocator>
Nested allocator class
(C++11)
<memory_resource>
Polymorphic allocators and memory resources
(C++17)
Numeric limits
<cstdint>
Fixed-width integer types and limits of other types
(C++11)
<system_error>
Defines std::error_code, a platform-dependent error code
(C++11)
<cuchar>
C-style Unicode character conversion functions
(C++11)
<string_view>
std::basic_string_view class template
(C++17)
<charconv>
std::to_chars and std::from_chars
(C++17)
<format>
Formatting library including std::format
(C++20)
Containers library
<array>
std::array container
(C++11)
<vector> std::vector container
<deque> std::deque container
<list> std::list container
<forward_list>
std::forward_list container
(C++11)
<unordered_set> std::unordered_set and std::unordered_multiset unordered
(C++11) associative containers
<unordered_map> std::unordered_map and std::unordered_multimap unordered
(C++11) associative containers
<span>
std::span view
(C++20)
Iterators library
<iterator> Range iterators
Ranges library
<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
<cmath> Common mathematics functions
<random>
Random number generators and distributions
(C++11)
<ratio>
Compile-time rational arithmetic
(C++11)
<cfenv>
Floating-point environment access functions
(C++11)
<bit>
Bit manipulation functions
(C++20)
<numbers>
Math constants
(C++20)
Localization library
<locale> Localization utilities
<codecvt>
Unicode conversion facilities
(C++11)(deprecated in C++17)
Input/output library
<iosfwd> Forward declarations of all classes in the input/output library
std::basic_stringstream, std::basic_istringstream, std::basic_ostringst
<sstream>
ream class templates and several typedefs
<syncstream>
std::basic_osyncstream, std::basic_syncbuf, and typedefs
(C++20)
<strstream>
std::strstream, std::istrstream, std::ostrstream
(deprecated in C++98)
<stop_token>
Stop tokens for std::jthread
(C++20)
<mutex>
Mutual exclusion primitives
(C++11)
<shared_mutex>
Shared mutual exclusion primitives
(C++14)
<future>
Primitives for asynchronous computations
(C++11)
<condition_variable>
Thread waiting conditions
(C++11)
<semaphore>
Semaphores
(C++20)
<latch> Latches
(C++20)
<barrier>
Barriers
(C++20)
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.
<assert.h>
Behaves same as <cassert>
(deprecated)
<errno.h>
Behaves same as <cerrno>
(deprecated)
<float.h>
Behaves same as <cfloat>
(deprecated)
<limits.h>
Behaves same as <climits>
(deprecated)
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++.
<iso646.h>
Has no effect
(deprecated)