#include <iostream>
using namespace std;
class Widget;
typedef void(Widget::*Ptr)();
class Widget
{
public:
Ptr ReturnHandler()
{
return &Widget::test;
}
private:
void test()
{
cout << "test returned" << endl;
}
};
int main()
{
Widget w;
Ptr ptr = w.ReturnHandler();
(w.*ptr)();
return 0;
}
Ptr ReturnHandler
最新推荐文章于 2024-10-30 10:00:00 发布