Bug 1461450 - Part 1: Add move constructors and assignment operators to nsTArray, r=froydnj

This commit is contained in:
Nika Layzell 2018-07-06 19:26:59 -04:00
Родитель 69a27ed832
Коммит 4658f7e519
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -2535,6 +2535,13 @@ public:
this->AppendElements(aOther);
}
AutoTArray(self_type&& aOther)
: nsTArray<E>()
{
Init();
this->SwapElements(aOther);
}
explicit AutoTArray(const base_type& aOther)
: mAlign()
{
@ -2569,6 +2576,12 @@ public:
return *this;
}
self_type& operator=(self_type&& aOther)
{
base_type::operator=(std::move(aOther));
return *this;
}
template<typename Allocator>
self_type& operator=(const nsTArray_Impl<elem_type, Allocator>& aOther)
{