附录 A:头文件清单(C++14 要求 vs 本库)
以 C++14 §17.6.1.2 Table 14(C++ 库头)与 Table 15(C 库头)为基准,列出本手册正文未单独成节的头。「可用性」按 13.1 的交付配置判定。
Table 14 —— 当前可用
| 头 | 说明 |
|---|---|
<scoped_allocator> | 可用(部分实体为 C++17 增补,本配置下不可见) |
<initializer_list> | 可用 |
<ratio> | 可用(部分实体为 C++17 增补,本配置下不可见) |
<chrono> | 可用(含 duration / time_point / ratio 运算;steady_clock 不可用,见 L6) |
<typeindex> | 可用 |
<iosfwd> | 可用(纯前向声明;一旦含 <ios> 即撞 D8) |
<valarray> | 可用 |
Table 14 —— 当前不可用
<strstream>(经 <wctype.h>)、<codecvt>、<regex>、<locale>、<future>、<mutex>、<condition_variable>、<thread>(依据见 13.4)。
Table 15
| 头 | 当前可用性 |
|---|---|
<cassert> | 可用 |
<cctype> | 可用 |
<clocale> | 可用(经 <locale.h>;std::localeconv() / std::setlocale() 均可用) |
<cwctype> | 不可用(宽字符 #error) |
<cuchar> | 未提供(偏差 D12) |
<cwchar> | 不可用(宽字符 #error) |
<exception> 覆盖度(编译 + 链接 + 运行):
- 4 / 4.1 全部条目可用 ——
std::exception、bad_exception、terminate/set_terminate/get_terminate、uncaught_exception、current_exception、exception_ptr,以及<stdexcept>的 9 个异常类,均链接并运行通过(terminate()按预期以 SIGABRT 终止)。 nested_exception:可构造、可链接(本配置下无 throw/catch,无实际用途)。rethrow_exception/make_exception_ptr:能链接,但一调用即终止(-fno-exceptions下转abort),无实际用途。- 注意:上述"不可用"判定不可仅凭
-fsyntax-only:shared_ptr(L1)与<system_error>(L9)都是编译通过、链接失败。全部结论均经链接期验证。
<system_error> 覆盖度:整节不可用 —— error_code / error_condition / system_error / 错误类别连默认构造都无法链接。见 13.2 D11 / 13.7.1 L9。
<new> 覆盖度:nothrow 版本、set_new_handler / get_new_handler、bad_alloc / bad_array_new_length —— C++14 下可用。