This is the sample code:
typedef int (T::*t1)(long);
typedef int (*T::*t2)(long);
t1 p1 = NULL;
t2 p2 = NULL;
The type t2 get's extra * (by mistake), but this code compile and run OK. But when t2 is not NULL, it gets error:
struct T
{
int func(long) {return 0;}
};
t2 p2 = &T::func;
error: cannot convert ‘int (T::*)(long int)’ to ‘t2’ {aka ‘int (* T::*)(long int)’} in initialization
I'm curious, what's the real type of t2? How can I use t2?