to in this case declare an enum and the string representations at once. X-macro lists can also be passed to other macros, but you would be severely limited by the fact that you can't use preprocessor directives inside of a macro; including a file has no such limitations
View all comments
Show parent comment
12
u/TheChief275 Jul 05 '26 edited Jul 05 '26
It's the X-macro pattern. You define a list of elements, e.g.
where X is undefined and then include a file that contains e.g.
to in this case declare an enum and the string representations at once. X-macro lists can also be passed to other macros, but you would be severely limited by the fact that you can't use preprocessor directives inside of a macro; including a file has no such limitations