How to make a preprocessor macro greedy?
问题 We have the following preprocessor macro. Its used to help with Doxygen documentation because Doxygen has troubles with C++ and some template typedefs: #if defined(DOXYGEN_PROCESSING) # define DOCUMENTED_TYPEDEF(x, y) class y : public x {}; #else # define DOCUMENTED_TYPEDEF(x, y) typedef x y; #endif It works great when X is a non-template or has only one template parameter. However, if X is a template with multiple parameters: DOCUMENTED_TYPEDEF(Foo<R,S>,Bar); Then it results in compile