Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-03 19:57:43


AMDG

Vjekoslav Brajkovic wrote:
> On Thu, 3 Jul 2008, Steven Watanabe wrote:
>
>> Does it work if you use mem_fn?
>>
>> boost::bind(
>> boost::mem_fn(&com_client::handle_connect),
>> this,
>> 2,
>> boost::asio::placeholders::error,
>> ++endpoint_iterator)
>>
>> How about an explicit return type?
>>
>> boost::bind<void>(
>> &com_client::handle_connect,
>> this,
>> 2,
>> boost::asio::placeholders::error,
>> ++endpoint_iterator)
>>
>>
>
> Nope. Same errors. I've tried both suggestions and their combinations
> with no success.

Exactly the same errors? Including the third line of the error message?
I've marked that parts I would expect to be different.

/usr/local/include/boost-1_35/boost/bind/bind_template.hpp:15:
instantiated from ‘boost::_bi::bind_t<
**boost::_bi::unspecified** // void??
, void (com_client::*)(command_t, const boost::system::error_code&,
boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>),
//Something involving _mfi::?? ^^^^^^^^^^^

boost::_bi::list3<boost::_bi::value<com_client*>, boost::arg<1> (*)(),
boost::_bi::value<boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>
> > >’

What is the type of boost::mem_fn(&com_client::handle_connect)?
I usually get this information using

#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>

BOOST_MPL_ASSERT((boost::is_same<__typeof__(boost::mem_fn(&com_client::handle_connect)),
void>));

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net