Fix consuming_buffers value_type (API Change):

This fixes a bug where instantiations of consuming_buffers with
buffer sequence types whose value_type is not const_buffer or
mutable_buffer can cause compilation errors.

The function consumed_buffers is removed.
This commit is contained in:
Vinnie Falco
2017-07-20 08:12:13 -07:00
parent 8f535ba74f
commit 6afa6afc98
6 changed files with 60 additions and 69 deletions
+4 -4
View File
@@ -283,10 +283,10 @@ public:
{
static std::size_t constexpr size = 3;
std::size_t n = s.size();
auto cb = consumed_buffers(
boost::asio::const_buffers_1(
s.data(), n), 0);
streambuf sb(size);
consuming_buffers<
boost::asio::const_buffers_1> cb{
boost::asio::const_buffers_1(s.data(), n)};
streambuf sb{size};
while(n)
{
auto const amount = (std::min)(n, size);