P99

◆ P99_IS_INTEGRAL_CONSTANT

#define P99_IS_INTEGRAL_CONSTANT (   EXP)    P99_GENERIC_INTEGRAL_CONSTANT((EXP), true, false)

Test if the expression EXP is an integral constant in the sense of the C standard.

An integral constant is any compile time constant of integral type (that is of integer or enum type) that is the result of an expression containing only integer literals, integral enumeration constants and certain sizeof and _Alignof evaluations.

Warning
Any expression of pointer type should result in false, even if the value of the pointer is a constant 0.
A compile time constant of pointer value that is of an incomplete type (e.g a forward declared struct pointer) other than void* could result in a diagnostic or even error. This can be considered as restriction for this macro.
Remarks
A const qualified variable of value of integer type should result in false.
A literal of type float or double even with value 0.0 should result in false. This will not change, even if such a literal is used to compute an integral value such as in !!0.0.
EXP will only be evaluated for its type, not for its value.
The evaluation of this macro by itself results in a compile time expression of value false or true.
See also
P99_IS_NULLPTR_CONSTANT
P99_IS_NULLPTR
Remarks
argument 0 maybe evaluated several times for its type but only once for its value

Definition at line 1789 of file p99_generic.h.