cpp/feature test

The standard defines a set of preprocessor macros corresponding to C++ language and library features introduced in C++11 or later. They are intended as a simple and portable way to detect the presence of said features.

Attributes
Checks for the support of an attribute named by (after macro expansion).

For standard attributes, it will expand to the year and month in which the attribute was added to the working draft (see table below), the presence of vendor-specific attributes is determined by a non-zero value.

can be expanded in the expression of and. It is treated as a defined macro by, and  but cannot be used anywhere else.

Language features
The following macros are predefined in every translation unit. Each macro expands to an integer literal corresponding to the year and month when the corresponding feature has been included in the working draft.

When a feature changes significantly, the macro will be updated accordingly.

Library features
The following macros are defined if the header or any of the corresponding headers in the table below is included. Each macro expands to an integer literal corresponding to the year and month when the corresponding feature has been included in the working draft.

When a feature changes significantly, the macro will be updated accordingly.