mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 11:27:15 +02:00
Add member function template find_previous_node_impl
so it can be used in heterogenous contexts
This commit is contained in:
@ -3618,9 +3618,9 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the node before the key, so that it can be erased.
|
template <class KeyEqual, class Key>
|
||||||
link_pointer find_previous_node(
|
link_pointer find_previous_node_impl(
|
||||||
const_key_type& k, std::size_t bucket_index)
|
KeyEqual const& eq, Key const& k, std::size_t const bucket_index)
|
||||||
{
|
{
|
||||||
link_pointer prev = this->get_previous_start(bucket_index);
|
link_pointer prev = this->get_previous_start(bucket_index);
|
||||||
if (!prev) {
|
if (!prev) {
|
||||||
@ -3634,7 +3634,7 @@ namespace boost {
|
|||||||
} else if (n->is_first_in_group()) {
|
} else if (n->is_first_in_group()) {
|
||||||
if (node_bucket(n) != bucket_index) {
|
if (node_bucket(n) != bucket_index) {
|
||||||
return link_pointer();
|
return link_pointer();
|
||||||
} else if (this->key_eq()(k, this->get_key(n))) {
|
} else if (eq(k, this->get_key(n))) {
|
||||||
return prev;
|
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
|
// Extract and erase
|
||||||
|
|
||||||
inline node_pointer extract_by_key(const_key_type& k)
|
inline node_pointer extract_by_key(const_key_type& k)
|
||||||
|
Reference in New Issue
Block a user