I am having an issue compiling this piece of code error
/usr/include/boost/bind/bind_mf_cc.hpp:91:5: error: initializing argument 5 of ‘boost::_bi::bind_t, typename boost::_bi::list_av_4::type> boost::bind(R (T::*)(B1, B2, B3), A1, A2, A3, A4) [with R = void; T = tcpReader; B1 = const boost::system::error_code&; B2 = unsigned int; B3 = boost::asio::basic_streambuf<>&; A1 = tcpReader*; A2 = boost::system::error_code; A3 = unsigned int; A4 = boost::asio::basic_streambuf<>; typename boost::_bi::list_av_4::type = boost::_bi::list4, boost::_bi::value, boost::_bi::value, boost::_bi::value > >]
void tcpReader::handle_read(const boost::system::error_code& ec, std::size_t bytes_transferred, boost::asio::streambuf& buf)
// inside a class method
boost::asio::streambuf buf;
boost::asio::async_read_until(*sock,buf,"\n" ,
boost::bind(&tcpReader::handle_read,this,error,buf.size(),buf)
);
Any ideas on what the problem is ? It I know I am missing something simple but I cannot figure it out is it something like I will have to use boot::buffer ?
Thanks in advance
boost::asio::placeholders::error
, andboost::asio::placeholders::bytes_transferred
instead oferr
andbuf.size()
respectively? – Chadbuf
withboost::ref(buf)
. – Chad