mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
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:
parent
16393582a7
commit
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;
|
||||
|
Loading…
Reference in New Issue
Block a user