1

const iterator + separate iterator from list.h

This commit is contained in:
2022-07-18 21:55:06 +02:00
parent b9fe5d7d53
commit 2e4c0339a3
4 changed files with 52 additions and 41 deletions

View File

@ -23,11 +23,11 @@ public:
// Implement linked traversal by extending the ListIterator
template<typename T>
class LinkedListIterator : public ListIterator<T> {
class LinkedListIterator : public Iterator<T> {
public:
using Type = typename ListIterator<T>::Type;
using Type = typename Iterator<T>::Type;
LinkedListIterator(Type* ptr) : ListIterator<T>(ptr) {}
LinkedListIterator(Type* ptr) : Iterator<T>(ptr) {}
LinkedListIterator& operator++() override {
// ptr is of type Wrapper<T>*