Use default move function
This commit is contained in:
parent
fe50f6590a
commit
85454857d3
@ -242,19 +242,9 @@ class DeallocatingVector
|
|||||||
// copying is not safe since this would only do a shallow copy
|
// copying is not safe since this would only do a shallow copy
|
||||||
DeallocatingVector(DeallocatingVector &other) = delete;
|
DeallocatingVector(DeallocatingVector &other) = delete;
|
||||||
DeallocatingVector &operator=(DeallocatingVector &other) = delete;
|
DeallocatingVector &operator=(DeallocatingVector &other) = delete;
|
||||||
|
// moving is fine
|
||||||
DeallocatingVector(DeallocatingVector &&other)
|
DeallocatingVector(DeallocatingVector &&other) = default;
|
||||||
{
|
DeallocatingVector &operator=(DeallocatingVector &&other) = default;
|
||||||
bucket_list = std::move(other.bucket_list);
|
|
||||||
current_size = std::move(other.current_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
DeallocatingVector &operator=(DeallocatingVector &&other)
|
|
||||||
{
|
|
||||||
bucket_list = std::move(other.bucket_list);
|
|
||||||
current_size = std::move(other.current_size);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
~DeallocatingVector() { clear(); }
|
~DeallocatingVector() { clear(); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user