Fixes #241: flat_map should support same interface as std::map

This commit is contained in:
Ion Gaztañaga
2024-06-28 14:04:00 +02:00
parent 6f10e52887
commit df03ffc8ec
8 changed files with 142 additions and 3 deletions
@@ -536,6 +536,19 @@ struct node_alloc_holder
return this->icont().erase_and_dispose(k, chain_holder.get_chain_builder());
}
template<class Key, class KeyCompare>
inline size_type erase_key(const Key& k, KeyCompare cmp, version_1)
{
return this->icont().erase_and_dispose(k, cmp, Destroyer(this->node_alloc()));
}
template<class Key, class KeyCompare>
inline size_type erase_key(const Key& k, KeyCompare cmp, version_2)
{
allocator_multialloc_chain_node_deallocator<NodeAlloc> chain_holder(this->node_alloc());
return this->icont().erase_and_dispose(k, cmp, chain_holder.get_chain_builder());
}
protected:
struct cloner
{