зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1359653: Part 3 - Add a clear() method and move asssignment operator to AutoCleanLinkedList. r=waldo
MozReview-Commit-ID: 2bUTMPviJzg --HG-- extra : source : b49bd726c8a6e955c672df17b2b9134ab3ad34d5
This commit is contained in:
Родитель
16393582a7
Коммит
7d8720d597
|
@ -647,6 +647,17 @@ class AutoCleanLinkedList : public LinkedList<T>
|
|||
{
|
||||
public:
|
||||
~AutoCleanLinkedList()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
AutoCleanLinkedList& operator=(AutoCleanLinkedList&& aOther)
|
||||
{
|
||||
LinkedList<T>::operator=(Forward<LinkedList<T>>(aOther));
|
||||
return *this;
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
while (T* element = this->popFirst()) {
|
||||
delete element;
|
||||
|
|
Загрузка…
Ссылка в новой задаче