The full error I'm getting is this:
error: ambiguous overload for ‘operator[]’ in ‘a[boost::_bi::storage4<A1, A2, A3,
boost::arg<I> >::a4_ [with A1 = boost::_bi::value<MsgProxy*>, A2 = boost::arg<1>, A3 =
boost::arg<2>, int I = 3]]’
It references line 116 of a class I have, which is the boost::bind call in this function:
// Dispatch a message onto all connected clients
void MsgProxy::dispatch_msg(t_ic_msg_shptr message) {
deque<t_socket_shptr>::const_iterator iter = clientList_.begin();
for(; iter != clientList_.end(); ++iter) {
message->async_send(*iter,
boost::bind(&MsgProxy::handle_dispatch, this, _1, _2, _3));
}
}
For reference, the handle dispatch function looks like this:
// Called to handle result of saync_send command in dispatch_msg
void MsgProxy::handle_dispatch(t_ic_msg_shptr messsage, t_socket_shptr socket_ptr,
const boost::system::error_code &error) {
if (error) {
RDEBUG("Error forwarding message onto clients -- %s",
error.message().c_str());
}
}
And finally the async_send function that's being called:
void async_send (t_socket_shptr, t_icsend_callback);
Where t_icsend_callback is:
typedef boost::function<void (t_socket_shptr, const boost::system::error_code&)>
t_icsend_callback;
Basically I've got a function (async_send) that takes a socket to send out a message on, as well as a callback (defined using boost::function) to report status to asynchronously. I'm trying to bind a member to that boost::function argument, but boost doesn't seem to like what I'm doing here. I've been up and down the boost::function and boost:bind documentation and it seems to me this should work... I even have a call that's almost identical a little further up that's not throwing an error... color me stumped.