Fixes #236 ("flat_tree::erase_unique uses wrong iterator")

This commit is contained in:
Ion Gaztañaga committed 2023-02-13 10:04:07 +01:00
1 parent 8ec0bda4ba
commit 5cea4e8718
2 files changed
+3 -2

No files matched your search

+2 -2
View File
@@ -1129,8 +1129,8 @@ class flat_tree
size_type erase_unique(const key_type& k)
{
iterator i = this->find(k);
size_type ret = static_cast<size_type>(i != this->end());
const_iterator i = static_cast<const flat_tree &>(*this).find(k);
size_type ret = static_cast<size_type>(i != this->cend());
if (ret)
this->erase(i);
return ret;