mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
committed by
Vinnie Falco
parent
ad42096a9d
commit
4fb535ece6
@ -5,6 +5,7 @@ Version 153:
|
||||
* Use boost::winapi::GetLastError() consistently
|
||||
* Update README.md for branches
|
||||
* Avoid string_view::clear
|
||||
* Fix iterator version of basic_fields::erase
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -609,11 +609,11 @@ basic_fields<Allocator>::
|
||||
erase(const_iterator pos) ->
|
||||
const_iterator
|
||||
{
|
||||
auto next = pos.iter();
|
||||
auto next = pos;
|
||||
auto& e = *next++;
|
||||
set_.erase(e);
|
||||
list_.erase(e);
|
||||
delete_element(e);
|
||||
list_.erase(pos);
|
||||
delete_element(const_cast<value_type&>(e));
|
||||
return next;
|
||||
}
|
||||
|
||||
|
@ -388,6 +388,20 @@ public:
|
||||
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
|
||||
testContainer()
|
||||
{
|
||||
@ -980,6 +994,7 @@ public:
|
||||
testHeaders();
|
||||
testRFC2616();
|
||||
testErase();
|
||||
testIteratorErase();
|
||||
testContainer();
|
||||
testPreparePayload();
|
||||
|
||||
|
Reference in New Issue
Block a user