#include <functional>
#include <iostream>
using namespace std;
class C {
public:
C() {
auto f = bind(&C::work,
this,
static_cast<function<bool()>>(bind(&C::step1, this)),
static_cast<function<bool()>>(bind(&C::step2, this)));
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+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpjbGFzcyBDIHsKcHVibGljOgoJQygpIHsKCQlhdXRvIGYgPSBiaW5kKCZDOjp3b3JrLAoJCSAgICAgICAgICAgICAgdGhpcywKCQkgICAgICAgICAgICAgIHN0YXRpY19jYXN0PGZ1bmN0aW9uPGJvb2woKT4+KGJpbmQoJkM6OnN0ZXAxLCB0aGlzKSksCgkJICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxmdW5jdGlvbjxib29sKCk+PihiaW5kKCZDOjpzdGVwMiwgdGhpcykpKTsKCgkJZigpOwoJfQpwcml2YXRlOgoJdm9pZCB3b3JrKGZ1bmN0aW9uPGJvb2woKT4gZm4xLCBmdW5jdGlvbjxib29sKCk+IGZuMikgewoJCWNvdXQgPDwgZm4xKCkgPDwgJyAnIDw8IGZuMigpIDw8IGVuZGw7Cgl9CgoJYm9vbCBzdGVwMSgpIHsgcmV0dXJuIHRydWU7IH0KCWJvb2wgc3RlcDIoKSB7IHJldHVybiB0cnVlOyB9Cn07CgppbnQgbWFpbigpIHsKCUMgZm9vOwp9