Possible Duplicate:
Trouble with template parameters used in macros
I’m trying to figure out a way to get this to work without changing the structure of INHERIT:
#define INHERIT(t) foo<t>
template<typename A, typename B>
struct bar : INHERIT(bar<A, B>) {};
The problem is that the invocation of INHERIT contains a comma.
I’m trying to support older compilers so variadic macros and template aliases are not an option. Is there anyway to fix this?
Use a little tricky macros:
These macros cause that preprocessor stop treating comma as its syntax – the comma starts be treated as just part of argument.
An alternative way:
NOTE
These examples these does not compile without: