#include <functional>
#include <iostream>
using namespace std;
class C {
public:
C() {
function<bool()> a = std::bind(&C::step1, this), b = std::bind(&C::step2, this);
auto f = bind(&C::work, this, a, b);
f();
}
private:
void work(function<bool()> fn1, function<bool()> fn2) {
cout << fn1() << ' ' << fn2() << endl;
}
bool step1() { return true; }
bool step2() { return true; }
};
int main() {
C foo;
}
I2luY2x1ZGUgPGZ1bmN0aW9uYWw+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpjbGFzcyBDIHsKcHVibGljOgoJQygpIHsKCQlmdW5jdGlvbjxib29sKCk+IGEgPSBzdGQ6OmJpbmQoJkM6OnN0ZXAxLCB0aGlzKSwgYiA9IHN0ZDo6YmluZCgmQzo6c3RlcDIsIHRoaXMpOwoJCWF1dG8gZiA9IGJpbmQoJkM6OndvcmssIHRoaXMsIGEsIGIpOwoKCQlmKCk7Cgl9CnByaXZhdGU6Cgl2b2lkIHdvcmsoZnVuY3Rpb248Ym9vbCgpPiBmbjEsIGZ1bmN0aW9uPGJvb2woKT4gZm4yKSB7CgkJY291dCA8PCBmbjEoKSA8PCAnICcgPDwgZm4yKCkgPDwgZW5kbDsKCX0KCglib29sIHN0ZXAxKCkgeyByZXR1cm4gdHJ1ZTsgfQoJYm9vbCBzdGVwMigpIHsgcmV0dXJuIHRydWU7IH0KfTsKCmludCBtYWluKCkgewoJQyBmb287Cn0=