forked from boostorg/beast
allocator_traits::construct is used for user-defined types:
It should only be called when constructing a user-provided type. Close #1332 Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
4 files changed
+29
-21
No files matched your search
@@ -302,6 +302,21 @@ public:
|
||||
buffers_cat(buffers_prefix(i, buffers), cb));
|
||||
}
|
||||
|
||||
void
|
||||
testSingleBuffer()
|
||||
{
|
||||
char c[1] = {};
|
||||
auto b = net::const_buffer(c, 1);
|
||||
auto bs = buffers_cat(net::const_buffer(c, 1));
|
||||
auto first = net::buffer_sequence_begin(bs);
|
||||
auto last = net::buffer_sequence_end(bs);
|
||||
BOOST_ASSERT(first != last);
|
||||
BEAST_EXPECT(std::distance(first, last) == 1);
|
||||
net::const_buffer b2(*first);
|
||||
BEAST_EXPECT(b.data() == b2.data());
|
||||
BEAST_EXPECT(b.size() == b2.size());
|
||||
}
|
||||
|
||||
void run() override
|
||||
{
|
||||
testBufferSequence();
|
||||
@@ -309,6 +324,7 @@ public:
|
||||
testEmpty();
|
||||
testGccWarning1();
|
||||
testGccWarning2();
|
||||
testSingleBuffer();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user