Use default move function

This commit is contained in:
Patrick Niklaus 2017-04-06 11:24:23 +00:00 committed by Patrick Niklaus
parent fe50f6590a
commit 85454857d3

View File

@ -242,19 +242,9 @@ class DeallocatingVector
// copying is not safe since this would only do a shallow copy
DeallocatingVector(DeallocatingVector &other) = delete;
DeallocatingVector &operator=(DeallocatingVector &other) = delete;
DeallocatingVector(DeallocatingVector &&other)
{
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;
}
// moving is fine
DeallocatingVector(DeallocatingVector &&other) = default;
DeallocatingVector &operator=(DeallocatingVector &&other) = default;
~DeallocatingVector() { clear(); }