3 Jul 22:09
[Boost.Bind] Adding a single argument to an existing function, breaks the code.
From: Vjekoslav Brajkovic <balkan <at> cs.washington.edu>
Subject: [Boost.Bind] Adding a single argument to an existing function, breaks the code.
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-07-03 20:12:20 GMT
Subject: [Boost.Bind] Adding a single argument to an existing function, breaks the code.
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-07-03 20:12:20 GMT
Hi.
I am experiencing some issues with boost::bind and I was hoping if
anybody is willing to help me. The example is really simple:
First I have a function:
void com_client::handle_init(
const std::string& host,
const command_t command) {
boost::asio::ip::tcp::resolver resolver(connection_.socket().io_service());
boost::asio::ip::tcp::resolver::query query(host, service_);
boost::asio::ip::tcp::resolver::iterator endpoint_iterator;
endpoint_iterator = resolver.resolve(query);
boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
connection_.socket().async_connect(endpoint,
boost::bind(
&com_client::handle_connect,
this,
2,
boost::asio::placeholders::error,
++endpoint_iterator)
);
}
After successful handshake, this function is called:
(Continue reading)
RSS Feed