In the example of an asynchronous tcp server, a function is associated at boost (all this happens in a class that inherits enable_shared_from_this ):
boost::asio::async_write(socket_, boost::asio::buffer(message_), boost::bind(&tcp_connection::handle_write, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); ... void handle_write(const boost::system::error_code& /*error*/, size_t /*bytes_transferred*/) { } Why when calling boost::bind(...) in its arguments is passed to shared_from_this() ? What's the point if all the arguments to boost::bind(...) (except the first) are to be used as arguments to handle_write(...) , but are there no pointer to classes in the arguments to handle_write(...) ?