...
The expansion of the macro m
will result in the expression ++i
being used as an unevaluated operand to sizeof()
. However, the expectation of the programmer at the expansion loci is that i
is preincremented only once. This exception still requires compliance with Consequently, this is a safe macro, and complies with PRE31-C. Avoid side effects in arguments to unsafe macros. Compliance with that rule is especially important for code that follows this exception.
The following code is an example of compliant code using an unevaluated operand in a SFINAE context to determine whether a type can be postfix incremented:
...