#include <stdlib.h>
#include <stdio.h>
class xtest
{
public :
void xfunc(void) {
printf("hello clase func ptr !\n");
}
};
typedef void (xtest::*xfunc)(void);
template <typename TYPE, void(TYPE::*fptr)(void)>
void* xthread_func(void* param)
{
TYPE* This = (TYPE*)param;
(This->*fptr)();
return NULL;
}
void class_fptr_test(void)
{
xfunc fptr = NULL;
xtest t;
fptr = &xtest::xfunc;
(t.*fptr)();
xthread_func<xtest, &xtest::xfunc>(&t);
return ;
}
int main(int argc, char* argv[])
{
class_fptr_test();
return 0;
}