Why does sequence iteration work in C macro?
When writing C macro, there is a trick called "sequence iteration". It looks like as follow: #define CAT(a, ...) PRIMITIVE_CAT(a, __VA_ARGS__) #define PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__ #define FUNCTION(name) void name(); #define FUNCTION_TABLE(seq) CAT(FUNCTION_TABLE_1 seq, _END) #define FUNCTION_TABLE_1(x) FUNCTION(x) FUNCTION_TABLE_2 #define FUNCTION_TABLE_2(x) FUNCTION(x) FUNCTION_TABLE_1 #define FUNCTION_TABLE_1_END #define FUNCTION_TABLE_2_END FUNCTION_TABLE((x) (y) (z) (e)) The sequence, i.e. the argument of FUCTION_TABLE, will be processed one by one. However, as far as I know, a token will not be expanded twice in the same scope. Because it is "painted blue". When FUNCTION_TABLE_2 is expanded, the macro FUNCTION_TABLE_1 has already been painted yet. Why is it still expanded?
What is the difference between these different ways to invoke an operator on `this`?
Saving variables after a form is closed in WinForms with C++
How to call OnEraseBkgnd() to repaint the window in another function? (MFC)
How can I convert this C# foreach code to C++?
Dynamic int pointer address? [duplicate]
x86 MASM - passing and accessing a 2D array
Boost.spirit x3 compiler error when using semantic action in VS15
g++ undefined reference with a shared library [duplicate]
How can I pass an ifstream as argument to std::thread function?
File handling in c++ to read two integers
linux scheduling to strictly prefer higher priority thread than low priority thread
Returning reference using a ternery expression causes runtime error
In which cases is it okay to allocate on the stack
Simplest way to know a class's type
Draw a vector<glm::vec3> opengl c++
Normal member methods with same name as templated member methods