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?
Error when modifying vector member of another class
Interrupt Service Routine can't be called directly
Lambda capture by default reference vs named
convert bitset<64> to string every 8 bit
argument of type “int” incompatible with parameter of type “int”
When is the correct time to call restoreState for QHeaderView?
How does it pass lvalue reference to std::forward with CRTP?
Using lower_bound function in loop is giving runtime error?
Problems with rand(), always taking the same random generated number [duplicate]
Reading Credentials file fails with error 32
The mechanism of shared_ptr
C++ specialized function template
Compiler errors with cmath on Mac OS X
Array of fstream in C++
Error: (E107) bind interface to port failed: interface already bound to port: port 'MC8051_ALU().AM.port_27' (sc_in)
Error LINK2019 when I try to make a training for face detection [duplicate]