Concatenate multiple tokens for X macro
问题 I'm trying to use X macros and preprocessor concatenation, both for the first time, together. I've read a lot of the other questions on SO related to preprocessor concatenation but not yet been able to wrap my head around them or how to adapt those to my use case. The list of items is a list of ID numbers for a bunch of structs , like so: #define LIST_OF_ID_NUMS \ X(1) \ X(2) \ X(3) \ X(4) \ X(5) \ X(6) \ X(7) \ X(8) \ X(9) \ X(10) \ X(11) I can declare the structs like so: #define X(id_num)