I have a template class named something like "BaseClass<type>". Some of the members require different stdlib functions depending on the type used (like strlen for char, something for wchar_t).
So I tried specializing my template ("BaseClass<char>"). But as far as I can see I have to implement ALL of the BaseClass methods because in the specialization they simply do not exist, because the BaseClass template is not the parent class of the specialization.
I googled the problem, tried several solutions but GCC is still complaining.
e.G.:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
template <class type>
class BaseClass {
protected:
type* a,
int b;
public:
someMember(type* x) {
b = someStdlibCallLikeSTRLEN(x);
}
};
template <>
class BaseClass<char> {
...
};
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
template <>
class BaseClass<char> {
protected:
type* a,
int b;
...
};
template <class type>
class BaseClass : public BaseClass<char> {
public:
someMember(type* x) {
b = someStdlibCallLikeSTRLEN(x);
}
};
I hope this amount of information helps you finding me a solution, but if requested, of course I will provide more information.
Also, I'm assuming the first bit of code you posted is one version of the code, and the second bit of code you posted is the second version..but both don't exist within the same project.. is this correct?