4 ms·
__UEXP_COUNTER__ is required so that you can abstract creating unique symbols: #define MAC(...) WHATEVER UNIQ(X) WHATEVER without __UEXP_COUNTER__, you woul
by kazinator 4y ago
__UEXP_COUNTER__ is required so that you can abstract creating unique symbols:
#define MAC(...) WHATEVER UNIQ(X) WHATEVER
without __UEXP_COUNTER__, you would have to pass __EXP_COUNTER__ as an extra argument to UNIQ(X).
You cannot make a nickname for __EXP_COUNTER__; e.g.
#define EC __EXP_COUNTER__
because the expansion of EC itself has its own counter!
Using __UEXP_COUNTER__, UNIQ(X) can just do everything necessary: obtain MAC's counter, and combine it with the prefix X.