Passing a unique_ptr reference to boost::bind?
问题 I'm on CentOS 6.6 (gcc 4.4.7) and developing with Boost.Asio (1.41). I'd like io_service to call member function run() in manger object m when it starts. The code I'm trying to compile looks like: #include <memory> #include <boost/asio.hpp> #include <boost/bind.hpp> boost::asio::io_service io; std::unique_ptr<manager> m; m = std::make_unique<manager>; io.post(boost::bind(&manager::run, &m)); gcc pitches a fit on the boost::bind statement, which includes: /usr/include/boost/bind/mem_fn