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
, &