You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: no matching function for call to ‘boost::asio::mutable_buffer::mutable_buffer(const boost::asio::const_buffers_1&)’
The weird thing is that following code compiles:
auto b1 = asio::buffer(getRecvBuffer());
Following code compiles too:
auto buf = client.socketRecvBuffer_.recvBuffer();
socket_.async_receive(asio::buffer(buf), [](auto&&...) {});
It seems in order to create a mutable_buffer, I need a lvalue for the buffer, which makes sense in case of std::vector, but it does not make sense for boost::span.
The text was updated successfully, but these errors were encountered:
I have a function that returns a buffer as a span to read the data from socket:
boost::span<std::byte> getRecvBuffer();
When I call
tcp::socket::async_receive(asio::buffer(getRecvBuffer()))
,socket_.async_receive(asio::buffer(getRecvBuffer()), [](auto&&...) {});
... I get an error:
The weird thing is that following code compiles:
auto b1 = asio::buffer(getRecvBuffer());
Following code compiles too:
It seems in order to create a
mutable_buffer
, I need a lvalue for the buffer, which makes sense in case ofstd::vector
, but it does not make sense forboost::span
.The text was updated successfully, but these errors were encountered: