|
|
Each of following macros is defined if the header<version> or one of the corresponding headers specified in the table is included.
A hardened implementation also defines the following macros:
Macro name | Value | Header | Free- standing |
---|---|---|---|
__cpp_lib_hardened_array | 202502L | <array> | |
__cpp_lib_hardened_basic_string | 202502L | <string> | |
__cpp_lib_hardened_basic_string_view | 202502L | <string_view> | |
__cpp_lib_hardened_bitset | 202502L | <bitset> | |
__cpp_lib_hardened_deque | 202502L | <deque> | |
__cpp_lib_hardened_expected | 202502L | <expected> | |
__cpp_lib_hardened_forward_list | 202502L | <forward_list> | |
__cpp_lib_hardened_inplace_vector | 202502L | <inplace_vector> | |
__cpp_lib_hardened_list | 202502L | <list> | |
__cpp_lib_hardened_mdspan | 202502L | <mdspan> | |
__cpp_lib_hardened_optional | 202502L | <optional> | |
__cpp_lib_hardened_span | 202502L | <span> | |
__cpp_lib_hardened_valarray | 202502L | <valarray> | |
__cpp_lib_hardened_vector | 202502L | <vector> | |
Total number of macros: 14 |
Each value in "Value" column follows the pattern:"yyyymmL", where"yyyy" is a year, and"mm" is a month when the corresponding feature-set was accepted for standardization. Some values where increased since the time of their introduction, if capabilities of given feature where extended. The table above contains only the most recent values (that is, taken from the latest C++ language draft standard). A full set of values, including the initial and intermediate ones, can be found inthis table.
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 4126 | C++20 C++23 | some feature-test macros for fully freestanding features were not freestanding | they are also freestanding |
Feature testing(C++20) | A set of preprocessor macros to test the corresponding to C++ language and library features |
C++ documentation forHeaders required for a freestanding implementation | |
C++ documentation forPredefined Macro Symbols |