
Hello, Can you please help me uncomment out the last "bind" of the program pasted below? The problem is that it will require some kind of mechanism to dereference the shared_ptr. Thank you, Chris === #include <boost/bind.hpp> #include <boost/function.hpp> #include <boost/make_shared.hpp> #include <boost/shared_ptr.hpp> #include <boost/utility.hpp> using namespace boost; struct C : noncopyable { C() {} void f() {} }; shared_ptr<C> GetC(int) { return make_shared<C>(); } int main() { function<void(C&)> x = bind(&C::f, _1); function<void(shared_ptr<C>)> y = bind(&C::f, _1); // Call x after first computing 42, GetC, and shared_ptr::operator* x(*GetC(42)); // Same as above, but with bind and ref bind(x, ref(*GetC(42)))(); // Similar to above, but delay calling 42, GetC, shared_ptr::operator*, // and ref until later. Also use y (takes a shared_ptr) vs x (that takes // a reference) bind(y, bind(GetC, _1))(42); // Same as above, but use x vs y // todo: add call to operator* // todo: add call to ref // // bind(x, bind(GetC, _1))(42); return 0; }