evaluates to 1
if the identifier is currently defined
as a macro name
(that is, if it is predefined
or if it has one or more active macro definitions ([cpp.import]
for example because
it has been the subject of a
without an intervening
directive with the same subject identifier), 0
if it is not.
The header or source file identified by
the parenthesized preprocessing token sequence
in each contained has-include-expression
is searched for as if that preprocessing token sequence
were the pp-tokens
in a #include
except that no further macro expansion is performed.
If such a directive would not satisfy the syntactic requirements
of a #include
directive, the program is ill-formed.
if the search for the source file succeeds, and
if the search fails.
Prior to evaluation,
macro invocations in the list of preprocessing tokens
that will become the controlling constant expression
(except for those macro names modified by the
just as in normal text.
If the token
is generated as a result of this replacement process
or use of the
unary operator does not match one of the two specified forms
prior to macro replacement,
the behavior is undefined.
The resulting tokens comprise the controlling constant expression
which is evaluated according to the rules of [expr.const]
using arithmetic that has at least the ranges specified
For the purposes of this token conversion and evaluation
all signed and unsigned integer types
act as if they have the same representation as, respectively,
Thus on an
implementation where std::numeric_limits<int>::max()
and std::numeric_limits<unsigned int>::max()
the integer literal 0x8000
is signed and positive within a #if
expression even though it is unsigned in translation phase
— end note
This includes interpreting character-literal
s, which may involve
converting escape sequences into execution character set members.
Whether the numeric value for these character-literal
matches the value obtained when an identical character-literal
occurs in an expression
(other than within a
Thus, the constant expression in the following
is not guaranteed to evaluate to the same value in these two
#if 'z' - 'a' == 25
if ('z' - 'a' == 25)
— end note
Also, whether a single-character character-literal
may have a negative
Each subexpression with type
is subjected to integral promotion before processing continues.
Each directive's condition is checked in order.
If it evaluates to false (zero),
the group that it controls is skipped:
directives are processed only through the name that determines
the directive in order to keep track of the level
of nested conditionals;
the rest of the directives' preprocessing tokens are ignored,
as are the other preprocessing tokens in the group.
Only the first group
whose control condition evaluates to true (nonzero) is processed;
any following groups are skipped and their controlling directives
are processed as if they were in a group that is skipped.
If none of the conditions evaluates to true,
and there is a
the group controlled by the
is processed; lacking a
directive, all the groups until the