C preprocessor macro specialisation based on an argument
Well first, you can do pattern matching with the preprocessor using the ##. This is how an IIF macro could be defined: #define IIF(cond) IIF_ ## cond #define IIF_0(t, f) f #define IIF_1(t, f) t However there is one problem with this approach. A subtle side effect of the ## operator is that it inhibits … Read more