diff --git a/include/boost/unordered/detail/buckets.hpp b/include/boost/unordered/detail/buckets.hpp index c2ea2306..5710a83d 100644 --- a/include/boost/unordered/detail/buckets.hpp +++ b/include/boost/unordered/detail/buckets.hpp @@ -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(); } diff --git a/include/boost/unordered/detail/equivalent.hpp b/include/boost/unordered/detail/equivalent.hpp index ea4b438c..39b77cf3 100644 --- a/include/boost/unordered/detail/equivalent.hpp +++ b/include/boost/unordered/detail/equivalent.hpp @@ -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:: + select_on_container_copy_construction(x.node_alloc())) {} equivalent_table(equivalent_table const& x, value_allocator const& a) : table_base(x, a) {} diff --git a/include/boost/unordered/detail/table.hpp b/include/boost/unordered/detail/table.hpp index c2f1fa77..28fe3ba7 100644 --- a/include/boost/unordered/detail/table.hpp +++ b/include/boost/unordered/detail/table.hpp @@ -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), diff --git a/include/boost/unordered/detail/unique.hpp b/include/boost/unordered/detail/unique.hpp index 858cc5ad..92b41a3a 100644 --- a/include/boost/unordered/detail/unique.hpp +++ b/include/boost/unordered/detail/unique.hpp @@ -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:: + 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)