3 ms·
The struct enumeration thing is certainly useful for homogenous vectors being written as structs, but one of the issues is that it requires the preprocessor to
by arthur2e5 5y ago
The struct enumeration thing is certainly useful for homogenous vectors being written as structs, but one of the issues is that it requires the preprocessor to have significantly more knowledge of the underlying language. Would it be a better idea to have something generate X Macros from struct defs instead?
- eqvinox 5y agoYeah, the enumerations require the preprocessor to understand the language and process the struct definitions... which may not even exist yet if they contain macros :D. It's not an easy problem. Generating some kind of macro-usable list like you suggest is probably the way to go, essentially making the entire thing a 2-pass process. (That said, the C preprocessor doesn't have a concept of "lists", perhaps that's the thing to actually add here.)