Unordered: Fix erasing ranges, and some tests. Fixes #7471

[SVN r80958]
This commit is contained in:
Daniel James
2012-10-11 17:29:19 +00:00
parent ced2139eea
commit 81897a6469
9 changed files with 368 additions and 28 deletions
@@ -676,9 +676,9 @@ namespace boost { namespace unordered { namespace detail {
if(begin == group2) {
link_pointer end1 = group1->group_prev_;
link_pointer end2 = group2->group_prev_;
link_pointer end2 = end->group_prev_;
group1->group_prev_ = end2;
group2->group_prev_ = end1;
end->group_prev_ = end1;
}
}
}
+10 -1
View File
@@ -618,7 +618,16 @@ namespace boost { namespace unordered { namespace detail {
{
for(;;) {
n = static_cast<node_pointer>(n->next_);
if (n == end) return;
if (n == end) {
if (n) {
std::size_t new_bucket_index =
policy::to_bucket(bucket_count_, n->hash_);
if (bucket_index != new_bucket_index) {
get_bucket(new_bucket_index)->next_ = prev;
}
}
return;
}
std::size_t new_bucket_index =
policy::to_bucket(bucket_count_, n->hash_);