#include <cstdio> // for printf.
class A
{
public:
A()
{
(this ->* A::table[0])();
(this ->* A::table[1])();
}
static auto make_table() -> void (A::* *)()
{
static void(A::* data_tmp[])() = { &A::f1, &A::f2 };
return data_tmp;
}
private:
static void (A::* *table)();
void f1() { std::printf("1\n"); }
void f2() { std::printf("2\n"); }
};
void (A::* *A::table)() = A::make_table();
auto main() -> int
{
A a;
}
I2luY2x1ZGUgPGNzdGRpbz4JLy8gZm9yIHByaW50Zi4KCmNsYXNzIEEKewpwdWJsaWM6CglBKCkKCXsKCQkodGhpcyAgICAtPiogICAgQTo6dGFibGVbMF0pKCk7CgkJKHRoaXMgICAgLT4qICAgIEE6OnRhYmxlWzFdKSgpOwoJfQoKCglzdGF0aWMgYXV0byBtYWtlX3RhYmxlKCkgLT4gdm9pZCAoQTo6KiAqKSgpCgl7CgkJc3RhdGljIHZvaWQoQTo6KiBkYXRhX3RtcFtdKSgpID0geyAmQTo6ZjEsICZBOjpmMiB9OwoJCXJldHVybiBkYXRhX3RtcDsKCX0KcHJpdmF0ZToKCXN0YXRpYyB2b2lkIChBOjoqICp0YWJsZSkoKTsKCXZvaWQgZjEoKSB7IHN0ZDo6cHJpbnRmKCIxXG4iKTsgfQoJdm9pZCBmMigpIHsgc3RkOjpwcmludGYoIjJcbiIpOyB9Cn07Cgp2b2lkIChBOjoqICpBOjp0YWJsZSkoKSA9IEE6Om1ha2VfdGFibGUoKTsKCgoKYXV0byBtYWluKCkgLT4gaW50CnsKCUEgYTsKfQo=