Unordered: Starting to implement allocator propagation.

[SVN r73679]
This commit is contained in:
Daniel James
2011-08-11 21:18:19 +00:00
parent 99e6bef4ef
commit eacca89d4e
4 changed files with 17 additions and 4 deletions

View File

@ -103,7 +103,16 @@ namespace boost { namespace unordered { namespace detail {
allocators_(a,a)
{
}
// TODO: Need to move allocators_, not copy. But compressed_pair
// doesn't support move parameters.
buckets(buckets& b, move_tag m)
: buckets_(),
bucket_count_(b.bucket_count),
allocators_(b.allocators_)
{
}
inline ~buckets()
{
if(this->buckets_) { this->delete_buckets(); }

View File

@ -34,7 +34,9 @@ namespace boost { namespace unordered { namespace detail {
hasher const& hf, key_equal const& eq, value_allocator const& a)
: table_base(n, hf, eq, a) {}
equivalent_table(equivalent_table const& x)
: table_base(x, x.node_alloc()) {}
: table_base(x,
allocator_traits<node_allocator>::
select_on_container_copy_construction(x.node_alloc())) {}
equivalent_table(equivalent_table const& x,
value_allocator const& a)
: table_base(x, a) {}

View File

@ -203,7 +203,7 @@ namespace boost { namespace unordered { namespace detail {
}
table(table& x, move_tag)
: buckets(x.node_alloc(), x.bucket_count_),
: buckets(boost::move(x.node_alloc()), x.bucket_count_),
functions(x),
size_(0),
mlf_(1.0f),

View File

@ -36,7 +36,9 @@ namespace boost { namespace unordered { namespace detail {
value_allocator const& a)
: table_base(n, hf, eq, a) {}
unique_table(unique_table const& x)
: table_base(x, x.node_alloc()) {}
: table_base(x,
allocator_traits<node_allocator>::
select_on_container_copy_construction(x.node_alloc())) {}
unique_table(unique_table const& x, value_allocator const& a)
: table_base(x, a) {}
unique_table(unique_table& x, move_tag m)