$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] Using Boost::Bind
From: David McCallum (dmccallum9_at_[hidden])
Date: 2011-06-28 17:00:24
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.