mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 21:34:46 +02:00
committed by
Vinnie Falco
parent
ad42096a9d
commit
4fb535ece6
@@ -5,6 +5,7 @@ Version 153:
|
|||||||
* Use boost::winapi::GetLastError() consistently
|
* Use boost::winapi::GetLastError() consistently
|
||||||
* Update README.md for branches
|
* Update README.md for branches
|
||||||
* Avoid string_view::clear
|
* Avoid string_view::clear
|
||||||
|
* Fix iterator version of basic_fields::erase
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -609,11 +609,11 @@ basic_fields<Allocator>::
|
|||||||
erase(const_iterator pos) ->
|
erase(const_iterator pos) ->
|
||||||
const_iterator
|
const_iterator
|
||||||
{
|
{
|
||||||
auto next = pos.iter();
|
auto next = pos;
|
||||||
auto& e = *next++;
|
auto& e = *next++;
|
||||||
set_.erase(e);
|
set_.erase(e);
|
||||||
list_.erase(e);
|
list_.erase(pos);
|
||||||
delete_element(e);
|
delete_element(const_cast<value_type&>(e));
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -388,6 +388,20 @@ public:
|
|||||||
BEAST_EXPECT(size(f) == 2);
|
BEAST_EXPECT(size(f) == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testIteratorErase()
|
||||||
|
{
|
||||||
|
f_t f;
|
||||||
|
f.insert("a", "x");
|
||||||
|
f.insert("b", "y");
|
||||||
|
f.insert("c", "z");
|
||||||
|
BEAST_EXPECT(size(f) == 3);
|
||||||
|
f_t::const_iterator i = std::next(f.begin());
|
||||||
|
f.erase(i);
|
||||||
|
BEAST_EXPECT(size(f) == 2);
|
||||||
|
BEAST_EXPECT(std::next(f.begin(), 0)->name_string() == "a");
|
||||||
|
BEAST_EXPECT(std::next(f.begin(), 1)->name_string() == "c");
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
testContainer()
|
testContainer()
|
||||||
{
|
{
|
||||||
@@ -980,6 +994,7 @@ public:
|
|||||||
testHeaders();
|
testHeaders();
|
||||||
testRFC2616();
|
testRFC2616();
|
||||||
testErase();
|
testErase();
|
||||||
|
testIteratorErase();
|
||||||
testContainer();
|
testContainer();
|
||||||
testPreparePayload();
|
testPreparePayload();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user