#include <iostream>
class Hoge {
private:
int a;
void f() { std::cout << "hoge:" << a << std::endl; }
public:
void (Hoge::*g())() { return &Hoge::f; }
Hoge(int a) { this->a = a; }
};
int main() {
Hoge *hoge = new Hoge(300);
(hoge->*(hoge->g()))();
delete hoge;
}
/* end */
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgSG9nZSB7CnByaXZhdGU6CiAgaW50IGE7CiAgdm9pZCBmKCkgeyBzdGQ6OmNvdXQgPDwgImhvZ2U6IiA8PCBhIDw8IHN0ZDo6ZW5kbDsgfQpwdWJsaWM6CiAgdm9pZCAoSG9nZTo6KmcoKSkoKSB7IHJldHVybiAmSG9nZTo6ZjsgfQogIEhvZ2UoaW50IGEpIHsgdGhpcy0+YSA9IGE7IH0KfTsKCmludCBtYWluKCkgewogIEhvZ2UgKmhvZ2UgPSBuZXcgSG9nZSgzMDApOwogIChob2dlLT4qKGhvZ2UtPmcoKSkpKCk7CiAgZGVsZXRlIGhvZ2U7Cn0KLyogZW5kICovCg==