3 ms·
There is __VA_OPT__ in C++2a, which handles recursion termination in macro expansion. This will probably be in future C, too, right? And if there was also __E
by tinkersleep 5y ago
There is __VA_OPT__ in C++2a, which handles recursion termination in macro expansion. This will probably be in future C, too, right?
And if there was also __EVAL__ to force the macro preprocessor into another evaluation level, you could write recursive macros quite easily, e.g., to wrap every argument into a function call:
#define EACH(f,x,...) f(x) __VA_OPT__(, __EVAL__(EACH(f, __VA_ARGS__)))
This would make the macro magic for this library trivial: you could process lists recursively.
Edit: added missing paren