struct X { static int f(long);int (*p2)(int) = &X::f; // error: mismatchint (X::*p4)(long) = &X::f; // error: mismatch
int (X::*p5)(int) = &(X::f); // error: wrong syntax for pointer to member
我想要编写一个模板,它接受指向成员函数的指针(可能是CV限定的和/或ref限定的),同时也匹配所有相关类型(返回值的类型、类类型和参数的类型)。ReturnValue(Class::* function_ptr)(Arguments...)) // do something with |function_ptr|这可以很好地适用于<e