diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index daf9b8f6..eb11219b 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -3618,9 +3618,9 @@ namespace boost { } } - // Find the node before the key, so that it can be erased. - link_pointer find_previous_node( - const_key_type& k, std::size_t bucket_index) + template + link_pointer find_previous_node_impl( + KeyEqual const& eq, Key const& k, std::size_t const bucket_index) { link_pointer prev = this->get_previous_start(bucket_index); if (!prev) { @@ -3634,7 +3634,7 @@ namespace boost { } else if (n->is_first_in_group()) { if (node_bucket(n) != bucket_index) { return link_pointer(); - } else if (this->key_eq()(k, this->get_key(n))) { + } else if (eq(k, this->get_key(n))) { return prev; } } @@ -3642,6 +3642,13 @@ namespace boost { } } + // Find the node before the key, so that it can be erased. + link_pointer find_previous_node( + const_key_type& k, std::size_t bucket_index) + { + return find_previous_node_impl(this->key_eq(), k, bucket_index); + } + // Extract and erase inline node_pointer extract_by_key(const_key_type& k)