#include <iostream>
#include <functional>
class Worker
{
std::function<void()> to_work;
public:
void work() const { to_work(); }
Worker(std::function<void()> work_func ) : to_work(work_func) {}
};
class Employer
{
public:
void work_bitch(const Worker& w)
{
w.work();
}
};
int main()
{
Employer e;
e.work_bitch(Worker([]() { std::cout << "I'm working\n"; }));
e.work_bitch(Worker([]() { std::cout << "I'm working too\n"; }));
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KCmNsYXNzIFdvcmtlcgp7CiAgc3RkOjpmdW5jdGlvbjx2b2lkKCk+IHRvX3dvcms7CnB1YmxpYzoKICB2b2lkIHdvcmsoKSBjb25zdCB7IHRvX3dvcmsoKTsgfQogIFdvcmtlcihzdGQ6OmZ1bmN0aW9uPHZvaWQoKT4gd29ya19mdW5jICkgOiB0b193b3JrKHdvcmtfZnVuYykge30KfTsKCmNsYXNzIEVtcGxveWVyCnsKcHVibGljOgogIHZvaWQgd29ya19iaXRjaChjb25zdCBXb3JrZXImIHcpCiAgewogICAgdy53b3JrKCk7CiAgfQp9OwoKaW50IG1haW4oKQp7CiAgRW1wbG95ZXIgZTsKCiAgZS53b3JrX2JpdGNoKFdvcmtlcihbXSgpIHsgc3RkOjpjb3V0IDw8ICJJJ20gd29ya2luZ1xuIjsgfSkpOwogIGUud29ya19iaXRjaChXb3JrZXIoW10oKSB7IHN0ZDo6Y291dCA8PCAiSSdtIHdvcmtpbmcgdG9vXG4iOyB9KSk7CgogIHJldHVybiAwOwp9