C++ 标准库头文件

按类别划分的 C++ 标准库和扩展的头文件。

按类别划分的标头

类别 标头
算法 <algorithm>、<cstdlib>、<numeric>
原子操作 <atomic> 11
C 库包装器 <cassert>、<ccomplex>11 a b、、、<cctype><cfenv><cerrno>11、、<cinttypes>11、<ciso646><cfloat>b<climits><csignal><clocale><cmath><csetjmp><cstdalign>、11 a b、<cstdarg><cstdbool>11 a b、<cstddef>、<cstdint>11、、<cstdio>、<cstring><cstdlib><ctgmath>11 a b、<ctime>、<cuchar>11、、 <cwchar><cwctype>
概念 <concepts> 20
Containers
序列容器 <array> 11、、<deque><forward_list>11、、<list>、<vector>
有序的关联容器 <map>、<set>
无序的关联容器 <unordered_map> 11、 <unordered_set>11
容器适配器 <queue>、<stack>
容器视图 <mdspan> 23, <span>20
诊断 <stacktrace> 23
错误和异常处理 <cassert>、 <exception>、 <stdexcept>、 <system_error>11
常规实用工具 <any> 17, <bit>20, , <bitset>, <execution><cstdlib>17, <expected>23, , <functional>, <memory><memory_resource>17<optional>, 17,<ratio>11<scoped_allocator>, 11<tuple><type_traits>, 11, 11, 11, <typeindex> 11, 11, <utility><variant>17
I/O 和格式设置 <cinttypes> 11、、<cstdio><filesystem>17、<format>20、<fstream>、<iomanip>、<istream><iostream><print><iosfwd><ios><ostream>、23、23、<spanstream>23、、<sstream>、c<strstream><streambuf>、<syncstream> 20
迭代器 <iterator>
语言支持 <cfloat>、<climits>、<codecvt>11 a、<compare>20、<coroutine>20、<csetjmp>、、<cstddef><cstdarg><csignal><cstdint>11、<cstdlib>、、<exception>、<initializer_list>11、<limits>、、<source_location><new>20、<stdfloat>23、<typeinfo><version>20
本地化 <clocale>、<codecvt>11 a、<cvt/wbuffer>、、、 <cvt/wstring><locale>
数学和数字 <bit> 20, <cfenv>11, , <cmath>, <complex>, <cstdlib><numbers><limits>20, <numeric>, <random>11, <ratio>11,<valarray>
内存管理 <allocators>、、<memory><memory_resource>17、<new>、<scoped_allocator>11
多线程处理 <atomic> 11, <barrier>20, <condition_variable>11<latch>, <future>20, 11, 20<shared_mutex>, <mutex>14<semaphore>,<stop_token>20, <thread>11
范围 <generator> 23, <ranges>20
正则表达式 <regex> 11
字符串和字符数据 <charconv> 17、、<cctype>、、<cstdlib>、<cuchar><cstring>11<cwchar><regex><cwctype>、<string_view><string>17
时间 <chrono> 11、 <ctime>

11 已在 C++11 标准中添加。
14 已在 C++14 标准中添加。
17 在 C++17 标准中添加。
20 在 C++20 标准中添加。
23 已在 C++23 标准中添加。
C ++17 标准中已弃用。
b 在 C++20 标准中删除。
c 在 C++98 标准中弃用。

类别 标头
算法 <algorithm>
C 库包装器 <cassert>, <cctype>, <cerrno>, <cfenv>, <cfloat>, <cinttypes>, <ciso646>, <climits>, <clocale>, <cmath>, <csetjmp>, <csignal>, <cstdarg>, <cstdbool>, <cstddef>, <cstdint>, <cstdio>, <cstdlib>, <cstring>, <ctgmath>, <ctime>, <cwchar>, <cwctype>
Containers
序列容器 <array>、<deque>、<forward_list>、<list>、<vector>
有序的关联容器 <map>、<set>
无序的关联容器 <unordered_map>、<unordered_set>
容器适配器 <queue>、<stack>
错误和异常处理 <exception>、<stdexcept>、<system_error>
I/O 和格式设置 <filesystem>、<fstream>、<iomanip>、<ios>、<iosfwd>、<iostream>、<istream>、<ostream>、<sstream>、<streambuf>、<strstream>
迭代器 <iterator>
本地化 <codecvt>、<cvt/wbuffer>、<cvt/wstring>、<locale>
数学和数字 <complex>、<limits>、<numeric>、<random>、<ratio>、<valarray>
内存管理 <allocators>、<memory>、<new>、<scoped_allocator>
多线程处理 <atomic>、<condition_variable>、<future>、<mutex>、<shared_mutex>、<thread>
其他实用工具 <bitset>、<chrono>、<functional>、<initializer_list>、<tuple>、<type_traits>、<typeinfo>、<typeindex>、<utility>
字符串和字符数据 <regex>、<string>、<string_view>

另请参阅

使用 C++ 库标头
C++ 标准库