[BOOST][asio] Compilation problem w/ Serialization example

Hi, 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? Compilation platform: PC Windows XP Visual C++ 7.1.3088 BOOST 1.33.1 Thanks in advance, Marc Viala mailto:mviala@acticm.com <mailto:mviala@acticm.com>

Hi Marc, --- Marc Viala <mviala@acticm.com> 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

Hi Chris, Thanks for your path. Here again we have to deal with VC7.1's subtleties... A+ Marc Viala mailto:mviala@acticm.com -----Message d'origine----- De : boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] De la part de Christopher Kohlhoff Envoyé : mardi 24 janvier 2006 13:23 À : boost@lists.boost.org Objet : Re: [boost] [BOOST][asio] Compilation problem w/ Serializationexample Hi Marc, --- Marc Viala <mviala@acticm.com> 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 _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Christopher Kohlhoff
-
Marc Viala
-
Marc VIALA