28 Jun
2011
28 Jun
'11
9 p.m.
I'm having some difficulty passing parameters to boost::bind. The approach taken by ASIO is to pass a placeholder to bind, like so: hostResolver->async_resolve(*nameQuery, boost::bind(&DClient::resolveHandler, this, boost::asio::placeholders::error, boost::asio::placeholders::iterator)); This works fine if I want to use an error or iterator as a parameter. But what if I want to use a primitive variable, or a pointer to one of my classes? Do I need to make a placeholder for each type of parameter I want to use? I looked in ASIO's placeholders.hpp file, and I must confess I can't make sense of it at all! Any help here is appreciated.