buffers_adaptor::subrange conforms to concept

Fixes #2459
This commit is contained in:
Mohammad Nejati
2024-02-06 16:22:15 +00:00
committed by Mohammad Nejati
parent 25105e476a
commit e0a9da265f
2 changed files with 12 additions and 0 deletions

View File

@ -44,6 +44,7 @@ public:
net::const_buffer>::type;
struct iterator;
using const_iterator = iterator;
// construct from two iterators plus optionally subrange definition
subrange(

View File

@ -18,6 +18,7 @@
#include <boost/beast/core/read_size.hpp>
#include <boost/beast/_experimental/unit_test/suite.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/asio/buffers_iterator.hpp>
#include <boost/asio/streambuf.hpp>
#include <iterator>
@ -114,6 +115,15 @@ public:
read_size(ba, 1024);
}
void
testIssue2459()
{
char s[13];
buffers_triple tb(s, sizeof(s));
buffers_adaptor<buffers_triple> b(tb);
ignore_unused(net::buffers_begin(b.data()));
}
template<bool isMutable>
void
testSubrange()
@ -165,6 +175,7 @@ public:
testDynamicBuffer();
testSpecial();
testIssue386();
testIssue2459();
testSubrange<true>();
testSubrange<false>();
}