#include <iostream>
using namespace std;
struct Test
{
void Method1()
{
cout << __FUNCTION__ << endl;
}
void Method2()
{
cout << __FUNCTION__ << endl;
}
};
void CallMethod(Test &test, void (Test::*p)())
{
(test.*p)();
}
int main() {
Test test;
printf("%u\n", sizeof(&Test::Method1));
printf("%u\n", sizeof(&main));
CallMethod(test, &Test::Method1);
CallMethod(test, &Test::Method2);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IFRlc3QKewoJdm9pZCBNZXRob2QxKCkKCXsKCQljb3V0IDw8IF9fRlVOQ1RJT05fXyA8PCBlbmRsOwoJfQoJdm9pZCBNZXRob2QyKCkKCXsKCQljb3V0IDw8IF9fRlVOQ1RJT05fXyA8PCBlbmRsOwoJfQp9OwoKdm9pZCBDYWxsTWV0aG9kKFRlc3QgJnRlc3QsIHZvaWQgKFRlc3Q6OipwKSgpKQp7CgkodGVzdC4qcCkoKTsKfQoKaW50IG1haW4oKSB7CglUZXN0IHRlc3Q7CglwcmludGYoIiV1XG4iLCBzaXplb2YoJlRlc3Q6Ok1ldGhvZDEpKTsKCXByaW50ZigiJXVcbiIsIHNpemVvZigmbWFpbikpOwoJQ2FsbE1ldGhvZCh0ZXN0LCAmVGVzdDo6TWV0aG9kMSk7CglDYWxsTWV0aG9kKHRlc3QsICZUZXN0OjpNZXRob2QyKTsKCXJldHVybiAwOwp9