I\'m currently refactoring some code the explicitly specializes a member function of a class template with two template parameters.
template
You can make Base class , where you can define all your members except bar() and then create derivative classes(one for general purpose, one for SomeType):
template
class FooBase
{
// All other members
};
template
class Foo:public FooBase
{
public:
void bar()
{
}
};
struct SomeType {};
template
class Foo:public FooBase
{
public:
void bar()
{
}
};
int main()
{
Foo b;
b.bar();
}