You are almost there; you just need to specify additional arguments make_sharedto indicate the type of parameter to accept. They are usually output, but if you do not specify them in the binding expression, then it tries to build the object by default MyBar.
std::function<std::shared_ptr<MyBar>(const MyFoo &)> functor =
std::bind(&std::make_shared<MyBar,MyFoo const&>, std::placeholders::_1);
source
share