class base_item
{
public:
void (base_item::*Handler)(void);
void AssignHandler(void (base_item::*handler)(void))
{
Handler=handler;
}
};
class derived_item:public base_item
{
public:
void func1(void)
{
}
void func2(void)
{
this->Handler=func1; //编译出错
(this->*Handler)();
}
void func3(void)
{
this->AssignHandler(func1); //编译出错
(this->*Handler)();
}
};
|