mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-31 20:04:29 +02:00
Add erase_node()
function to table, creating an optimizer-friendly function
This commit is contained in:
@@ -2928,6 +2928,23 @@ namespace boost {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iterator erase_node(c_iterator pos) {
|
||||||
|
c_iterator next = pos;
|
||||||
|
++next;
|
||||||
|
|
||||||
|
bucket_iterator itb = pos.itb;
|
||||||
|
node_pointer* pp = boost::addressof(itb->next);
|
||||||
|
while (*pp != pos.p) {
|
||||||
|
pp = boost::addressof((*pp)->next);
|
||||||
|
}
|
||||||
|
|
||||||
|
buckets_.extract_node_after(itb, pp);
|
||||||
|
this->delete_node(pos.p);
|
||||||
|
--size_;
|
||||||
|
|
||||||
|
return iterator(next.p, next.itb);
|
||||||
|
}
|
||||||
|
|
||||||
iterator erase_nodes_range(c_iterator first, c_iterator last)
|
iterator erase_nodes_range(c_iterator first, c_iterator last)
|
||||||
{
|
{
|
||||||
if (first == last) {
|
if (first == last) {
|
||||||
|
Reference in New Issue
Block a user