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
I would suggest you to remove the following implementation from your code altogether, so that compiler can generate error at compile-time itself if T is not int . Early detection of error is better than delay detection(which is done at runtime).
template
T MyClass::GetTFromVariable(shared_ptr v, string s)
{
throw std::runtime_error("Don't know how to convert " + ToString(v->GetString()));
}
There is exactly similar topic/issue discussing this thing. Please have a look at this:
Partial template specialization for specific type, c++