I am currently reorganizing some code that explicitly specializes in a member function of a class template with two template parameters.
template <class S, class T>
class Foo
{
void bar();
};
template <class S, class T>
void Foo<S, T>::bar()
{ }
template <>
void Foo<SomeType, SomeType>::bar()
{ }
Now I have added some more template parameters, so the class now looks like this:
template <class S, class EXTRA0, class T, class EXTRA1>
class Foo
{
void bar();
};
These two additional parameters just add typedefs to my class, so the functionality at runtime doesn't change. Is there a way to keep the (now partially) specialized implementation of the bar? I seem to be unable to understand the syntax, and I have a suspicion that this may not be possible.
Edit: I'm looking for something like:
template <class EXTRA0, class EXTRA1>
void foo<SomeType, EXTRA0, Sometype, EXTRA1>::bar()
{
}
which does not seem to compile.
ltjax source
share