Copy a streambuf's contents to a string

前端 未结 10 1998
时光取名叫无心
时光取名叫无心 2020-11-29 22:19

Apparently boost::asio::async_read doesn\'t like strings, as the only overload of boost::asio::buffer allows me to create const_buffer

10条回答
  •  离开以前
    2020-11-29 22:56

    I mostly don't like answers that say "You don't want X, you want Y instead and here's how to do Y" but in this instance I'm pretty sure I know what tstenner wanted.

    In Boost 1.66, the dynamic string buffer type was added so async_read can directly resize and write to a string buffer.

提交回复
热议问题