Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2006-01-24 07:23:25


Hi Marc,

--- Marc Viala <mviala_at_[hidden]> wrote:
> We are just trying to use Asio (ver 0.3.6) w/ BOOST 1.33.1 and
> we have some troubles during the compilation of the
> serialization example, more precisely the file
> "connection.hpp" @ line 79 : "boost::bind can't deduced
> arguments..." I've tried to replace with boost::lambda::bind
> but without success...
>
> Is there any patch of this example with our C++ platform?

Can you try the following change to connection.hpp, thanks.

@@ -73,8 +73,10 @@
   void async_read(T& t, Handler handler)
   {
     // Issue a read operation to read exactly the number of bytes in a
header.
+ void (connection::*f)(const asio::error&, T&,
boost::tuple<Handler>)
+ = &connection::handle_read_header<T, Handler>;
     asio::async_read(socket_, asio::buffer(inbound_header_),
- boost::bind(&connection::handle_read_header<T, Handler>,
+ boost::bind(f,
           this, asio::placeholders::error, boost::ref(t),
           boost::make_tuple(handler)));
   }
@@ -105,8 +107,10 @@

       // Start an asynchronous call to receive the data.
       inbound_data_.resize(inbound_data_size);
+ void (connection::*f)(const asio::error&, T&,
boost::tuple<Handler>)
+ = &connection::handle_read_data<T, Handler>;
       asio::async_read(socket_, asio::buffer(inbound_data_),
- boost::bind(&connection::handle_read_data<T, Handler>, this,
+ boost::bind(f, this,
           asio::placeholders::error, boost::ref(t), handler));
     }
   }

Cheers,
Chris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk