I'm having trouble specializing an inner template when it's parameters are all known. Here's an example:
template < typename T0 >
struct outer
{
template < typename T1 = void, typename T2 = void >
struct inner
{
typedef T1 type;
};
};
template < typename T0 >
template < typename T1 >
struct outer<T0>::inner<double,T1> { typedef int type; };
This works just fine. If I instead specify the inner template like so, it does not:
template < typename T0 >
template < >
struct outer<T0>::inner<double,void> { typedef int type; };
For this I get the error message, "invalid explicit specialization before ‘>’ token...enclosing class templates are not explicitly specialized...template parameters not used in partial specialization:...T0". Not sure WTAF is going on here.
I also tried this:
template < typename T0 >
struct outer<T0>::inner<double,void> { typedef int type; };
I expected this to fail and the error message is not surprising. It was: "too few template-parameter-lists".
So, what's the correct way to do this? I can of course hack around it, but if I don't have to I'd prefer not.