Explicitly implement move constructor for DeallocationVector

This commit is contained in:
Patrick Niklaus 2017-06-19 17:19:12 +00:00 committed by Patrick Niklaus
parent 97592e5bc3
commit 7fb57c924f

View File

@ -258,8 +258,12 @@ template <typename ElementT> class DeallocatingVector
DeallocatingVector(DeallocatingVector &other) = delete; DeallocatingVector(DeallocatingVector &other) = delete;
DeallocatingVector &operator=(DeallocatingVector &other) = delete; DeallocatingVector &operator=(DeallocatingVector &other) = delete;
// moving is fine // moving is fine
DeallocatingVector(DeallocatingVector &&other) = default; DeallocatingVector(DeallocatingVector &&other) { swap(other); }
DeallocatingVector &operator=(DeallocatingVector &&other) = default; DeallocatingVector &operator=(DeallocatingVector &&other)
{
swap(other);
return *this;
}
~DeallocatingVector() { clear(); } ~DeallocatingVector() { clear(); }