I can have a typedef function pointer in a class like this:
template<typename T>
class MyClass
{
public:
typedef T (*fptr)(T);
void doSomething(fptr my_fptr) { /*...*/ }
};
and this works fine. but if I inherit from such a class, as below:
template<typename T>
class MyClass
{
public:
typedef T (*fptr)(T);
virtual void doSomething(fptr my_fptr) = 0;
};
template<typename T>
class MyOtherClass: public MyClass<T>
{
public:
void doSomething(fptr my_fptr) { /*...*/ }
};
the compiler complains that fptr is undefined. is there a way of inheriting function pointer typedefs like this? thanks, james