That leaves the @ operator… which seems useful for specific cases (e.g. graphics rendering), but I can honestly say I don't really feel a need for that in the codebases I worked with.
But. Let me offer some suggestions for extensions! :)
An improved preprocessor would be massively useful if it had features like:
- enumerating struct members in preprocessor macros (something like:)
#define MACRO2(typename, fieldname, arg1, arg2) ... arg1 arg2 ...
#define MACRO(typename, arg1, arg2) something { #each-member(MACRO2, typename, arg1, arg2) }
struct bla {
int a, b;
}
MACRO(struct bla, x, y)
/* => something { MACRO2(struct bla, a, x, y) MACRO2(struct bla, b, x, y) } */
- same, for function parameters- and last but not least, macros consuming { } blocks, e.g.
#define MACRO(...)#{name} something something #{name} something #{name}
MACRO(1,2,3) {
this block is consumed by the macro and placed in 2nd and 3rd #{name} (first one just signals the macro consumes a {} block
}
...oh and, almost forgot, "extensible" macros: #define MACRO(...) abc
#ifdef MACRO
#extend MACRO(...) def MACRO(...) ghi
#else
#define MACRO(...) def stub ghi
#endif
(also, macros that can define other macros. Like _Pragma() => #pragma, _Define() => #define)