I know i\'m missing something easy here but I\'ve got a templated member function of a class which I\'ve specialised.
MyClass
{
template
As Alf noted, the full specialization is no longer a template. However, I am not sure it has to be defined inline. You should also be able to split the declaration and definition.
I.e. In your header have:
template<>
int MyClass::GetTFromVariable(shared_ptr v, string s);
and in the implementation have:
template<>
int MyClass::GetTFromVariable(shared_ptr v, string s)
{
return v->GetInteger();
}
I also had thought that by rights the templated definition should also be explicitly inline (I always have done so) but would not be too surprised if a given compiler was lax in applying the ODR for templates. I'd be interested to see the standard reference that states otherwise.