forked from boostorg/unordered
Move constructor implementation into containers
This commit is contained in:
1 parent
77bf2b5e33
commit
84f1ef6d2d
3 files changed
+53
-29
No files matched your search
@@ -3729,34 +3729,21 @@ struct table_unique : boost::unordered::detail::table<Types>
|
||||
: table(x, node_allocator_traits::select_on_container_copy_construction(
|
||||
x.node_alloc()))
|
||||
{
|
||||
if (x.size_) {
|
||||
this->copy_buckets(x);
|
||||
}
|
||||
}
|
||||
|
||||
table_unique(table_unique const& x, node_allocator const& a) : table(x, a)
|
||||
{
|
||||
if (x.size_) {
|
||||
this->copy_buckets(x);
|
||||
}
|
||||
}
|
||||
|
||||
table_unique(table_unique& x, boost::unordered::detail::move_tag m)
|
||||
: table(x, m)
|
||||
{
|
||||
// The move is done in the base class.
|
||||
}
|
||||
|
||||
table_unique(table_unique& x, node_allocator const& a,
|
||||
boost::unordered::detail::move_tag m)
|
||||
: table(x, a, m)
|
||||
{
|
||||
if (this->node_alloc() == x.node_alloc()) {
|
||||
this->move_buckets_from(x);
|
||||
} else if (x.size_) {
|
||||
// TODO: Could pick new bucket size?
|
||||
this->move_buckets(x);
|
||||
}
|
||||
}
|
||||
|
||||
// equals
|
||||
@@ -4438,34 +4425,19 @@ struct table_equiv : boost::unordered::detail::table<Types>
|
||||
: table(x, node_allocator_traits::select_on_container_copy_construction(
|
||||
x.node_alloc()))
|
||||
{
|
||||
if (x.size_) {
|
||||
copy_buckets(x);
|
||||
}
|
||||
}
|
||||
|
||||
table_equiv(table_equiv const& x, node_allocator const& a) : table(x, a)
|
||||
{
|
||||
if (x.size_) {
|
||||
copy_buckets(x);
|
||||
}
|
||||
}
|
||||
table_equiv(table_equiv const& x, node_allocator const& a) : table(x, a) {}
|
||||
|
||||
table_equiv(table_equiv& x, boost::unordered::detail::move_tag m)
|
||||
: table(x, m)
|
||||
{
|
||||
// The move is done in the base class.
|
||||
}
|
||||
|
||||
table_equiv(table_equiv& x, node_allocator const& a,
|
||||
boost::unordered::detail::move_tag m)
|
||||
: table(x, a, m)
|
||||
{
|
||||
if (this->node_alloc() == x.node_alloc()) {
|
||||
this->move_buckets_from(x);
|
||||
} else if (x.size_) {
|
||||
// TODO: Could pick new bucket size?
|
||||
this->move_buckets_equiv(x);
|
||||
}
|
||||
}
|
||||
|
||||
// Equality
|
||||
|
||||
Reference in new issue
Block a user