Apparently boost::asio::async_read
doesn't like strings, as the only overload of boost::asio::buffer
allows me to create const_buffer
s, so I'm stuck with reading everything into a streambuf.
Now I want to copy the contents of the streambuf into a string, but it apparently only supports writing to char* (sgetn()
), creating an istream with the streambuf and using getline()
.
Is there any other way to create a string with the streambufs contents without excessive copying?