| 541 | |
| 542 | template <typename H> |
| 543 | auto |
| 544 | IntrusiveHashMap<H>::erase(iterator const &loc) -> iterator { |
| 545 | value_type *v = loc; |
| 546 | iterator zret = ++(this->iterator_for(v)); // get around no const_iterator -> iterator. |
| 547 | Bucket *b = this->bucket_for(H::key_of(v)); |
| 548 | value_type *nv = H::next_ptr(v); |
| 549 | value_type *limit = b->limit(); |
| 550 | if (b->_v == v) { // removed first element in bucket, update bucket |
| 551 | if (limit == nv) { // that was also the only element, deactivate bucket |
| 552 | _active_buckets.erase(b); |
| 553 | b->clear(); |
| 554 | } else { |
| 555 | b->_v = nv; |
| 556 | --b->_count; |
| 557 | } |
| 558 | } |
| 559 | _list.erase(loc); |
| 560 | return zret; |
| 561 | } |
| 562 | |
| 563 | template <typename H> |
| 564 | bool |
nothing calls this directly
no test coverage detected