When working with the unit test framework, I came across a situation in which I would like to test the macros. Simply put, I would like to extend the macro FOO(x)
so that FOO(int)
short
and FOO(anything_else)
long
.
With C ++ templates, of course, this is not a problem. But here I need a real token replacement, not just a typedef
. That is, FOO(char) FOO(char) i;
must be a valid definition equal to long long i;
.
source share