fix list destructors
This commit is contained in:
@ -120,7 +120,7 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
~ArrayList() override {
|
||||
~ArrayList() {
|
||||
delete[] buf; // Deleting nullptr has no effect
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
~LinkedList() override {
|
||||
~LinkedList() {
|
||||
typename Iterator::Type* current = head;
|
||||
typename Iterator::Type* next;
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user