defined-macro-expression: defined identifier defined ( identifier )
h-preprocessing-token: any preprocessing-token other than >
h-pp-tokens: h-preprocessing-token h-pp-tokens h-preprocessing-token
header-name-tokens: string-literal < h-pp-tokens >
has-include-expression: __has_include ( header-name ) __has_include ( header-name-tokens )
has-attribute-expression: __has_cpp_attribute ( pp-tokens )
Attribute | Value |
carries_dependency | 200809L |
deprecated | 201309L |
fallthrough | 201603L |
likely | 201803L |
maybe_unused | 201603L |
no_unique_address | 201803L |
nodiscard | 201907L |
noreturn | 200809L |
unlikely | 201803L |
# if constant-expression new-line group # elif constant-expression new-line groupcheck whether the controlling constant expression evaluates to nonzero.
#if 'z' - 'a' == 25 if ('z' - 'a' == 25)
# ifdef identifier new-line group # ifndef identifier new-line groupcheck whether the identifier is or is not currently defined as a macro name.
#if __has_include(<optional>) # include <optional> # if __cpp_lib_optional >= 201603 # define have_optional 1 # endif #elif __has_include(<experimental/optional>) # include <experimental/optional> # if __cpp_lib_experimental_optional >= 201411 # define have_optional 1 # define experimental_optional 1 # endif #endif #ifndef have_optional # define have_optional 0 #endif— end example
#if __has_cpp_attribute(acme::deprecated) # define ATTR_DEPRECATED(msg) [[acme::deprecated(msg)]] #else # define ATTR_DEPRECATED(msg) [[deprecated(msg)]] #endif ATTR_DEPRECATED("This function is deprecated") void anvil();— end example