2
我們有一些.h文件中如何使用Boost :: asio :: buffer(buf,size)和boost綁定?
template <typename MutableBufferSequence>
int read_some(boost::asio::ip::tcp::socket& sock,
const MutableBufferSequence& buffers)
{
return sock.read_some(buffers);
}
而這樣的代碼,我們希望在我們的類函數成員函數:
boost::packaged_task<int> pt(boost::bind(&http_request::read_some, this, &socket, boost::asio::buffer(buffer, buffer_size)));
這給了我87個的編譯器錯誤和talls我, boost :: bind不能以這種方式工作。我想知道如何通過boost::bind
將boost::asio::buffer
傳遞給我的函數?
作爲'boost :: bind()'的第三個參數傳遞的''socket變量的類型是什麼? –