diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index e1cfc2e7..23c4314a 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -3800,14 +3800,16 @@ namespace boost { // // no throw - std::size_t erase_key_equiv(const_key_type& k) + template + std::size_t erase_key_equiv_impl(KeyEqual const& key_eq, Key const& k) { if (!this->size_) return 0; - std::size_t key_hash = this->hash(k); + std::size_t key_hash = policy::apply_hash(this->hash_function(), k); std::size_t bucket_index = this->hash_to_bucket(key_hash); - link_pointer prev = this->find_previous_node(k, bucket_index); + link_pointer prev = + this->find_previous_node_impl(key_eq, k, bucket_index); if (!prev) return 0; @@ -3825,6 +3827,11 @@ namespace boost { return deleted_count; } + std::size_t erase_key_equiv(const_key_type& k) + { + return this->erase_key_equiv_impl(this->key_eq(), k); + } + link_pointer erase_nodes_equiv(node_pointer i, node_pointer j) { std::size_t bucket_index = this->node_bucket(i);