[cpp.predefined] (original) (raw)
- __cplusplus
The integer literal 202002L.
[ Note
:
It is intended that future versions of this International Standard will replace the value of this macro with a greater value.
— end note
] - __DATE__
The date of translation of the source file: a character string literal of the form"Mmm dd yyyy", where the names of the months are the same as those generated by theasctimefunction, and the first character ofddis a space character if the value is less than 10.
If the date of translation is not available, an implementation-defined valid date shall be supplied. - __FILE__
The presumed name of the current source file (a character string literal).149 - __LINE__
The presumed line number (within the current source file) of the current source line (an integer literal).150 - __STDC_HOSTED__
The integer literal 1 if the implementation is a hosted implementation or the integer literal 0 if it is not. - __STDCPP_DEFAULT_NEW_ALIGNMENT__
An integer literal of type std::size_twhose value is the alignment guaranteed by a call to operator new(std::size_t)or operator new[](std::size_t).
[ Note
:
Larger alignments will be passed tooperator new(std::size_t, std::align_val_t), etc.
— end note
] - __TIME__
The time of translation of the source file: a character string literal of the form"hh:mm:ss"as in the time generated by theasctimefunction.
If the time of translation is not available, an implementation-defined valid time shall be supplied. - The names listed in Table 19.
The macros defined in Table 19 shall be defined to the corresponding integer literal.
[ Note
:
Future versions of this International Standard might replace the values of these macros with greater values.
— end note
]
Table 19: Feature-test macros [tab:cpp.predefined.ft]
| Macro name | Value |
|---|---|
| __cpp_aggregate_bases | 201603L |
| __cpp_aggregate_nsdmi | 201304L |
| __cpp_aggregate_paren_init | 201902L |
| __cpp_alias_templates | 200704L |
| __cpp_aligned_new | 201606L |
| __cpp_attributes | 200809L |
| __cpp_binary_literals | 201304L |
| __cpp_capture_star_this | 201603L |
| __cpp_char8_t | 201811L |
| __cpp_concepts | 201907L |
| __cpp_conditional_explicit | 201806L |
| __cpp_constexpr | 201907L |
| __cpp_constexpr_dynamic_alloc | 201907L |
| __cpp_constexpr_in_decltype | 201711L |
| __cpp_consteval | 201811L |
| __cpp_constinit | 201907L |
| __cpp_decltype | 200707L |
| __cpp_decltype_auto | 201304L |
| __cpp_deduction_guides | 201907L |
| __cpp_delegating_constructors | 200604L |
| __cpp_designated_initializers | 201707L |
| __cpp_enumerator_attributes | 201411L |
| __cpp_fold_expressions | 201603L |
| __cpp_generic_lambdas | 201707L |
| __cpp_guaranteed_copy_elision | 201606L |
| __cpp_hex_float | 201603L |
| __cpp_if_constexpr | 201606L |
| __cpp_impl_coroutine | 201902L |
| __cpp_impl_destroying_delete | 201806L |
| __cpp_impl_three_way_comparison | 201907L |
| __cpp_inheriting_constructors | 201511L |
| __cpp_init_captures | 201803L |
| __cpp_initializer_lists | 200806L |
| __cpp_inline_variables | 201606L |
| __cpp_lambdas | 200907L |
| __cpp_modules | 201907L |
| __cpp_namespace_attributes | 201411L |
| __cpp_noexcept_function_type | 201510L |
| __cpp_nontype_template_args | 201911L |
| __cpp_nontype_template_parameter_auto | 201606L |
| __cpp_nsdmi | 200809L |
| __cpp_range_based_for | 201603L |
| __cpp_raw_strings | 200710L |
| __cpp_ref_qualifiers | 200710L |
| __cpp_return_type_deduction | 201304L |
| __cpp_rvalue_references | 200610L |
| __cpp_sized_deallocation | 201309L |
| __cpp_static_assert | 201411L |
| __cpp_structured_bindings | 201606L |
| __cpp_template_template_args | 201611L |
| __cpp_threadsafe_static_init | 200806L |
| __cpp_unicode_characters | 200704L |
| __cpp_unicode_literals | 200710L |
| __cpp_user_defined_literals | 200809L |
| __cpp_using_enum | 201907L |
| __cpp_variable_templates | 201304L |
| __cpp_variadic_templates | 200704L |
| __cpp_variadic_using | 201611L |