I have declared a function in the Class definition inside a header file:
class A
{
public:
...
void* func(void *);
...
}
In a .C file, I've a pointer to the class A's object as ptr.
Now, when i create a pthread:
iret1 = pthread_create(&thread1, NULL, ptr->func, NULL);
It throws an error as: error: a pointer to a bound function may only be used to call the function.
But when I declare the function func as static, this error doesn't come.
I just want to know a workaround for this as I can't change the function to static since I can't call other non-static members from it.