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
}
};
당신은 사용해야