How can a child class passes its non-static member function to the parent class?
Expand|Select|Wrap|Line Numbers
- class A
- {
- public:
- typedef void *(*object_t)(void *);
- A(object_t f) : func(f) {}
- virtual ~A(){}
- private:
- object_t func;
- };
- class B : public A
- {
- public:
- B() : A(myFunc){}
- ~B(){}
- void *myFunc(void *){}
- };
Also, how can make the pthread_create to take a non-static member in class A? It was an error as well.
Thank you.
Jim