moved-from container with unequal allocator will not be modified:

Affects:
- flat_buffer
- multi_buffer
- http::fields

fixes #1832
closes #1834
This commit is contained in:
Richard Hodges
2020-02-04 18:36:53 +01:00
parent 6d10adf936
commit 7701bf8738
6 changed files with 9 additions and 18 deletions
@@ -124,8 +124,6 @@ basic_flat_buffer(
end_ = nullptr;
max_ = other.max_;
copy_from(other);
other.clear();
other.shrink_to_fit();
return;
}
@@ -436,8 +434,6 @@ move_assign(basic_flat_buffer& other, std::false_type)
if(this->get() != other.get())
{
copy_from(other);
other.clear();
other.shrink_to_fit();
}
else
{
@@ -502,8 +502,6 @@ basic_multi_buffer(
{
out_ = list_.end();
copy_from(other);
other.clear();
other.shrink_to_fit();
return;
}
@@ -1060,8 +1058,6 @@ move_assign(basic_multi_buffer& other, std::false_type)
if(this->get() != other.get())
{
copy_from(other);
other.clear();
other.shrink_to_fit();
}
else
{
-2
View File
@@ -382,7 +382,6 @@ basic_fields(basic_fields&& other, Allocator const& alloc)
if(this->get() != other.get())
{
copy_all(other);
other.clear_all();
}
else
{
@@ -1139,7 +1138,6 @@ move_assign(basic_fields& other, std::false_type)
if(this->get() != other.get())
{
copy_all(other);
other.clear_all();
}
else
{