Add a declaration for the specialised class:
template<typename A>
class Test<A, SpecialType>
{
public:
class TestInner
{
public:
TestInner& operator* ();
};
};
The problem is that you define an member for a specialization that is not declared. A specialization of a templated class does not share any members or methods with the generalised template, so the declaration of the generalised template doesn't serve as a declaration of any specialisations of that template class.
Consider this:
template <class T>
class Foo {
void GeneralFunction(T x);
}
and a specialization:
template <>
class Foo<int> {
void SpecialisedFunction(int x);
}
Here, Foo</*anything except int*/>
has only the method GeneralFunction
whereas Foo<int>
has only the method SpecialisedFunction
.
By the same logic, this is allowed also:
template<>
class Foo<float> {
float GeneralFunction; //here GeneralFunction is a data member, not a method.
}
Long story short you need to declare you specialisation.