I know it sounds awefully confusing, I have a base template class which has a function pointer, a child class(which is no longer a template class) needs to use that function pointer to point to a child class's member function, and I get all kinds of errors.. Did I violate some universal law of C++? here is the pseudo code:
template <class T>
class Base{
public:
typedef void (Base<T>::*fptr) (char in);
void funcA(fptr FuncToCall){
FuncToCall('a');
}
...
};
class Child:public Base<char>{
public:
void funcToCall(){...}
void funcB(){
funcA(funcToCall);
}
}
Here is the error message I got:
error C2664: 'Base< T >::funcA' : cannot convert parameter 1 from 'void (__thiscall Child::* )(char)' to 'void (__thiscall Base< T >::* )(char)'