谁能告诉我原因
typedef void (*pFn)();
class Test
{
public:
bool handleEvent(pFn pfn)
{
pfn();
return true;
}
static void go()
{
cout << "helloWorld" << endl;
}
};
void main()
{
Test tt;
tt.handleEvent(Test::go);
cin.get();
}
为什么go()必须是static类型的, 才能被注册到handleEvent()中去??????