Closed Weeena closed 8 years ago
If you have a class with two template parameters, e.g.
template <typename T, typename U> class TestClass { public: U foo(T param); };
registering this class to ponder with e.g.
PONDER_TYPE(TestClass<int, int>);
fails. (In my environment, which is VS2015, I get
warning C4002: too many actual parameters for macro 'PONDER_TYPE' error C2976: 'TestClass': too few template arguments
warning C4002: too many actual parameters for macro 'PONDER_TYPE'
error C2976: 'TestClass': too few template arguments
A possible fix could be to define PONDER_TYPE with a variadic macro like this:
PONDER_TYPE
#define PONDER_TYPE(...) \ namespace ponder \ { \ namespace detail \ { \ template <> struct StaticTypeId<__VA_ARGS__> \ { \ static const char* get(bool = true) {return #__VA_ARGS__;} \ enum {defined = true, copyable = true}; \ }; \ } \ }
This should be fixed in master latest.
If you have a class with two template parameters, e.g.
registering this class to ponder with e.g.
fails. (In my environment, which is VS2015, I get
A possible fix could be to define
PONDER_TYPE
with a variadic macro like this: