Here is some C++ code I\'m playing around with:
#include #include #define IN , #define FOREACH(x,y) for(unsigned int i=0;i&l
The preprocessor doesn't expand the IN to a comma until after it reads the arguments to FOREACH.
IN
FOREACH
I'm pretty sure that the c++ preprocessor is one pass only, so you'll have to use:
FOREACH(int item, ints) cout << item; ENDFOREACH