Unordered: delete_buckets works when buckets_ is null.

[SVN r80560]
This commit is contained in:
Daniel James
2012-09-17 18:58:28 +00:00
parent c2e7221bf9
commit 549b93e629

View File

@ -712,7 +712,7 @@ namespace boost { namespace unordered { namespace detail {
// Delete everything with current allocators before assigning // Delete everything with current allocators before assigning
// the new ones. // the new ones.
if (buckets_) delete_buckets(); delete_buckets();
allocators_.assign(x.allocators_); allocators_.assign(x.allocators_);
// Copy over other data, all no throw. // Copy over other data, all no throw.
@ -743,7 +743,7 @@ namespace boost { namespace unordered { namespace detail {
void move_assign(table& x, true_type) void move_assign(table& x, true_type)
{ {
if(buckets_) delete_buckets(); delete_buckets();
allocators_.move_assign(x.allocators_); allocators_.move_assign(x.allocators_);
move_assign_no_alloc(x); move_assign_no_alloc(x);
} }
@ -751,7 +751,7 @@ namespace boost { namespace unordered { namespace detail {
void move_assign(table& x, false_type) void move_assign(table& x, false_type)
{ {
if (node_alloc() == x.node_alloc()) { if (node_alloc() == x.node_alloc()) {
if(buckets_) delete_buckets(); delete_buckets();
move_assign_no_alloc(x); move_assign_no_alloc(x);
} }
else { else {
@ -881,7 +881,7 @@ namespace boost { namespace unordered { namespace detail {
using namespace std; using namespace std;
if(!size_) { if(!size_) {
if(buckets_) delete_buckets(); delete_buckets();
bucket_count_ = policy::new_bucket_count(min_buckets); bucket_count_ = policy::new_bucket_count(min_buckets);
} }
else { else {