How to parse tokens separated by whitespace in C++ preprocessor?

时间:2015-10-29 15:59:27

标签: c++ c-preprocessor preprocessor-meta-program

I'm doing some preprocessor meta-programming and I need a way to convert f(a b) to g(a,b) in C++ preprocessor. Since a and b are two tokens in C++, it seems possible to find a way to separate them. However, after hours of work there is still no solution to this problem.

Any third-party library including boost::preprocessor is welcomed given that these libraries work in preprocessing process.

Moreover, is there any way to separate arbitrary tokens? e.g const T& should be converted to const, T, &

0 个答案:

没有答案