mirror of
https://github.com/boostorg/container.git
synced 2025-08-02 05:54:28 +02:00
Fixes #236 ("flat_tree::erase_unique uses wrong iterator")
This commit is contained in:
@@ -1413,6 +1413,7 @@ use [*Boost.Container]? There are several reasons for that:
|
|||||||
|
|
||||||
* Fixed bugs/issues:
|
* Fixed bugs/issues:
|
||||||
* [@https://github.com/boostorg/container/issues/232 GitHub #232: ['"Fix using pmr::polymorphic_allocator in pre-main"]].
|
* [@https://github.com/boostorg/container/issues/232 GitHub #232: ['"Fix using pmr::polymorphic_allocator in pre-main"]].
|
||||||
|
* [@https://github.com/boostorg/container/issues/236 GitHub #236: ['"flat_tree::erase_unique uses wrong iterator"]].
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
@@ -1129,8 +1129,8 @@ class flat_tree
|
|||||||
|
|
||||||
size_type erase_unique(const key_type& k)
|
size_type erase_unique(const key_type& k)
|
||||||
{
|
{
|
||||||
iterator i = this->find(k);
|
const_iterator i = static_cast<const flat_tree &>(*this).find(k);
|
||||||
size_type ret = static_cast<size_type>(i != this->end());
|
size_type ret = static_cast<size_type>(i != this->cend());
|
||||||
if (ret)
|
if (ret)
|
||||||
this->erase(i);
|
this->erase(i);
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user