0
我有一個類實現如下。在構造函數中,我收到一個編譯錯誤。請你告訴我爲什麼?成員的函數指針錯誤
class A{
public:
typedef void (A::*HANDLER)();
void test1(){
printf("This is test 1");
}
void test2(){
printf("This is test 2");
}
A(){
HANDLER h= &A::test1;
h(); // an error spawn here with the description: term does not evaluate to a function taking 0 arguments
}
};