So, your whole method looks like:
void start_accept()
{
tcp_connection::pointer new_connection =
tcp_connection::create(acceptor_.get_io_service());
std::function<void(const boost::system::error_code &error)> callback = std::bind(&tcp_server::handle_accept, this, new_connection,
std::placeholders::_1);
acceptor_.async_accept(new_connection->socket(), callback);
}
Seems to compile.
I really don't understand how we are binding arguments that the template parameters did not specify the std::function to take.
Can I pass it a cow or a moose too and it won't care? As long as the callback takes a cow and a moose?
I thought all arguments had to be specified in the template params.