#include <iostream>
#include <functional>
using namespace std;
class Button {
function<void(void)> action;
public:
Button(function<void(void)> f) : action(f) {}
void click() {
action();
}
};
class WavePlayer {
public:
void load() {
cout << "loaded" << endl;
}
};
int main() {
WavePlayer player;
Button b([&] {
player.load();
});
b.click();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIEJ1dHRvbiB7CglmdW5jdGlvbjx2b2lkKHZvaWQpPiBhY3Rpb247CnB1YmxpYzoKICAgIEJ1dHRvbihmdW5jdGlvbjx2b2lkKHZvaWQpPiBmKSA6IGFjdGlvbihmKSB7fQogICAgdm9pZCBjbGljaygpIHsKICAgIAlhY3Rpb24oKTsKICAgIH0KfTsKCmNsYXNzIFdhdmVQbGF5ZXIgewpwdWJsaWM6CiAgICB2b2lkIGxvYWQoKSB7CiAgICAJY291dCA8PCAibG9hZGVkIiA8PCBlbmRsOwogICAgfQp9OwoKaW50IG1haW4oKSB7CglXYXZlUGxheWVyIHBsYXllcjsKCUJ1dHRvbiBiKFsmXSB7CgkJcGxheWVyLmxvYWQoKTsKCX0pOwoJYi5jbGljaygpOwoJcmV0dXJuIDA7Cn0=