fork() example asio 1_52_0

Hi...do you know what it means the parameters "_1" and "_2"? socket_.async_read_some(boost::asio::buffer(data_),boost::bind(&server::handle_read, this, _1, _2)); the complete example is: http://think-async.com/Asio/boost_asio_1_5_2/doc/html/boost_asio/example/for...

Hi,
Hi...do you know what it means the parameters "_1" and "_2"?
These are 'placeholders'. See the boost::bind documentation: http://www.boost.org/doc/libs/1_46_0/libs/bind/bind.html#Purpose -> _1 means "substitute with the first input argument." cheers, Remko

2011/3/11 Marco Piacentini
Hi...do you know what it means the parameters "_1" and "_2"?
socket_.async_read_some(boost::asio::buffer(data_),boost::bind(&server::handle_read, this, _1, _2));
They're just Bind's placeholders for 1st and 2nd parameters respectively, same as Asio's placeholders::error and placeholders::bytes_transferred in this case. HTH
participants (3)
-
Marco Piacentini
-
Remko Tronçon
-
TONGARI