1

fix list destructors

This commit is contained in:
2022-07-19 14:56:59 +02:00
parent c319c0b604
commit 2f47dc8f94
3 changed files with 2 additions and 4 deletions

View File

@ -120,7 +120,7 @@ private:
}
public:
~ArrayList() override {
~ArrayList() {
delete[] buf; // Deleting nullptr has no effect
}

View File

@ -65,7 +65,7 @@ private:
}
public:
~LinkedList() override {
~LinkedList() {
typename Iterator::Type* current = head;
typename Iterator::Type* next;

View File

@ -9,8 +9,6 @@
template<typename T, typename I = Iterator<T>>
class List {
public:
virtual ~List() = 0;
using Type = T; // We make the template argument accessible from the subclasses
using Iterator = I; // Needed for range based for loop