#include <iostream>
class Hoge {
private:
void f() { std::cout << "hoge" << std::endl; }
public:
Hoge() {}
};
int main() {
// ordinary
Hoge *hoge = new Hoge();
hoge->f();
// vir function-address
void (Hoge::*private_f)() = &Hoge::f;
(hoge->*private_f)();
delete hoge;
}
/* end */
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgSG9nZSB7CnByaXZhdGU6CiAgdm9pZCBmKCkgeyBzdGQ6OmNvdXQgPDwgImhvZ2UiIDw8IHN0ZDo6ZW5kbDsgfQpwdWJsaWM6CiAgSG9nZSgpIHt9Cn07CgppbnQgbWFpbigpIHsKLy8gb3JkaW5hcnkKICAgIEhvZ2UgKmhvZ2UgPSBuZXcgSG9nZSgpOwogICAgaG9nZS0+ZigpOwovLyB2aXIgZnVuY3Rpb24tYWRkcmVzcwogICAgdm9pZCAoSG9nZTo6KnByaXZhdGVfZikoKSA9ICZIb2dlOjpmOwogICAgKGhvZ2UtPipwcml2YXRlX2YpKCk7CiAgICBkZWxldGUgaG9nZTsKfQovKiBlbmQgKi8K