Something like, for example,
class A {
template<typename T> T DoStuff();
template<> virtual int DoStuff<int>() = 0;
};
Visual Studio 2010 says no, but I get a funny feeling that I simply messed up the syntax. Can explicit full specializations of a member function template be virtual?
Explicit specializations aren’t legal within a class. Even if you could make it a partial specialization you would still run into the “templates can’t be virtual” problem.
n3290, § 14.5.2 states:
And gives this example:
Before going on to state that member function templates do not count for virtual overrides too.