The standard library is declared in namespace std, through headers named
without an extension [headers]. This page lists every header of C++23 by group, and the standard that added it.
A hosted implementation provides all of them; a freestanding one provides a
subset. Headers shown as C++98 have been in the language since the first standard.
Modules
| Module | Exports | Since |
|---|---|---|
std | The whole library, in namespace std | C++23 |
std.compat | The same, plus the C library names in the global namespace | C++23 |
Language support
| Header | Provides | Since |
|---|---|---|
<cfloat> | Limits of floating-point types, as macros | C++98 |
<climits> | Limits of integer types, as macros | C++98 |
<compare> | Three-way comparison categories | C++20 |
<coroutine> | Coroutine support | C++20 |
<csetjmp> | setjmp and longjmp | C++98 |
<csignal> | Signal handling | C++98 |
<cstdarg> | Variable arguments | C++98 |
<cstddef> | std::size_t, std::byte and related definitions | C++98 |
<cstdint> | Fixed-width integer types | C++11 |
<cstdlib> | General utilities from C, such as std::malloc and std::exit | C++98 |
<exception> | Exception handling support | C++98 |
<initializer_list> | std::initializer_list | C++11 |
<limits> | std::numeric_limits | C++98 |
<new> | Allocation functions | C++98 |
<source_location> | std::source_location | C++20 |
<stdfloat> | Extended floating-point aliases | C++23 |
<typeindex> | std::type_index | C++11 |
<typeinfo> | std::type_info | C++98 |
<version> | Library feature-test macros | C++20 |
Concepts
| Header | Provides | Since |
|---|---|---|
<concepts> | The standard concepts | C++20 |
Diagnostics
| Header | Provides | Since |
|---|---|---|
<cassert> | The assert macro | C++98 |
<cerrno> | errno | C++98 |
<stacktrace> | std::stacktrace | C++23 |
<stdexcept> | Standard exception types | C++98 |
<system_error> | std::error_code and related types | C++11 |
Memory management
| Header | Provides | Since |
|---|---|---|
<memory> | Smart pointers and allocators | C++98 |
<memory_resource> | Polymorphic allocators | C++17 |
<scoped_allocator> | std::scoped_allocator_adaptor | C++11 |
Metaprogramming
| Header | Provides | Since |
|---|---|---|
<ratio> | Compile-time rational arithmetic | C++11 |
<type_traits> | Type traits | C++11 |
General utilities
| Header | Provides | Since |
|---|---|---|
<any> | std::any | C++17 |
<bit> | Bit manipulation and std::bit_cast | C++20 |
<bitset> | std::bitset | C++98 |
<expected> | std::expected | C++23 |
<functional> | Function objects and std::function | C++98 |
<optional> | std::optional | C++17 |
<tuple> | std::tuple | C++11 |
<utility> | std::pair, std::move, std::forward | C++98 |
<variant> | std::variant | C++17 |
Containers
| Header | Provides | Since |
|---|---|---|
<array> | std::array | C++11 |
<deque> | std::deque | C++98 |
<flat_map> | std::flat_map, std::flat_multimap | C++23 |
<flat_set> | std::flat_set, std::flat_multiset | C++23 |
<forward_list> | std::forward_list | C++11 |
<list> | std::list | C++98 |
<map> | std::map, std::multimap | C++98 |
<mdspan> | std::mdspan | C++23 |
<queue> | std::queue, std::priority_queue | C++98 |
<set> | std::set, std::multiset | C++98 |
<span> | std::span | C++20 |
<stack> | std::stack | C++98 |
<unordered_map> | std::unordered_map, std::unordered_multimap | C++11 |
<unordered_set> | std::unordered_set, std::unordered_multiset | C++11 |
<vector> | std::vector | C++98 |
Iterators, ranges and algorithms
| Header | Provides | Since |
|---|---|---|
<iterator> | Iterators | C++98 |
<generator> | std::generator | C++23 |
<ranges> | Ranges and views | C++20 |
<algorithm> | General algorithms | C++98 |
<numeric> | Numeric algorithms | C++98 |
<execution> | Execution policies for parallel algorithms | C++17 |
Strings and text
| Header | Provides | Since |
|---|---|---|
<cctype> | Character classification | C++98 |
<charconv> | std::to_chars, std::from_chars | C++17 |
<clocale> | C locale functions | C++98 |
<codecvt> | Unicode conversion facets. Deprecated in C++17 | C++11 |
<cstring> | C string and memory functions | C++98 |
<cuchar> | C Unicode conversion functions | C++11 |
<cwchar> | C wide-character functions | C++98 |
<cwctype> | Wide-character classification | C++98 |
<format> | std::format | C++20 |
<locale> | Locales | C++98 |
<regex> | Regular expressions | C++11 |
<string> | std::basic_string | C++98 |
<string_view> | std::basic_string_view | C++17 |
Numerics
| Header | Provides | Since |
|---|---|---|
<cfenv> | The floating-point environment | C++11 |
<cmath> | Mathematical functions | C++98 |
<complex> | Complex numbers | C++98 |
<numbers> | Mathematical constants | C++20 |
<random> | Random number generation | C++11 |
<valarray> | Numeric arrays | C++98 |
Time
| Header | Provides | Since |
|---|---|---|
<chrono> | Clocks, durations, and since C++20 calendars and time zones | C++11 |
<ctime> | C time functions | C++98 |
Input and output
| Header | Provides | Since |
|---|---|---|
<cinttypes> | Format macros for fixed-width integers | C++11 |
<cstdio> | C input and output | C++98 |
<filesystem> | std::filesystem | C++17 |
<fstream> | File streams | C++98 |
<iomanip> | Stream manipulators | C++98 |
<ios> | Stream base classes | C++98 |
<iosfwd> | Forward declarations of the stream classes | C++98 |
<iostream> | std::cin, std::cout, std::cerr | C++98 |
<istream> | Input streams | C++98 |
<ostream> | Output streams | C++98 |
<print> | std::print, std::println | C++23 |
<spanstream> | Streams over a fixed buffer | C++23 |
<sstream> | String streams | C++98 |
<streambuf> | Stream buffers | C++98 |
<strstream> | char* streams. Deprecated since C++98 | C++98 |
<syncstream> | Synchronised output streams | C++20 |
Concurrency
| Header | Provides | Since |
|---|---|---|
<atomic> | Atomic operations | C++11 |
<barrier> | std::barrier | C++20 |
<condition_variable> | std::condition_variable | C++11 |
<future> | std::future, std::promise | C++11 |
<latch> | std::latch | C++20 |
<mutex> | std::mutex and locks | C++11 |
<semaphore> | std::counting_semaphore | C++20 |
<shared_mutex> | std::shared_mutex and std::shared_lock | C++14 |
<stop_token> | std::stop_token | C++20 |
<thread> | std::thread, std::jthread | C++11 |
C compatibility headers
Each C standard header <name.h> can be included as it is. It declares its names
in the global namespace, and may also declare them in std. The
<cname> form declares them in std, and may also declare them
globally.
| Headers | Since |
|---|---|
<assert.h> <ctype.h> <errno.h> <float.h> <limits.h> <locale.h> <math.h> <setjmp.h> <signal.h> <stdarg.h> <stddef.h> <stdio.h> <stdlib.h> <string.h> <time.h> <wchar.h> <wctype.h> | C++98 |
<fenv.h> <inttypes.h> <stdint.h> <uchar.h> | C++11 |
<stdatomic.h> | C++23 |
Some C headers have no real content in C++:
| Header | Status |
|---|---|
<complex.h>, <tgmath.h> | Include <complex> and, for the second, <cmath> |
<ccomplex>, <ctgmath> | Added in C++11, deprecated in C++17, removed in C++20 |
<iso646.h> | Empty: the alternative tokens are built in |
<ciso646> | Removed in C++20 |
<stdalign.h>, <stdbool.h> | Each defines one compatibility macro |
<cstdalign>, <cstdbool> | Added in C++11, deprecated in C++17, removed in C++20 |
The C headers <stdnoreturn.h> and <threads.h> are not part of C++.