aboutsummaryrefslogtreecommitdiff
path: root/backend/ListIterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'backend/ListIterator.h')
-rw-r--r--backend/ListIterator.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/backend/ListIterator.h b/backend/ListIterator.h
index c7fbf4a..3d11806 100644
--- a/backend/ListIterator.h
+++ b/backend/ListIterator.h
@@ -10,30 +10,30 @@ class List;
template <typename T>
class ListIterator {
public:
- ListIterator(const List<T> & list, size_t index);
+ ListIterator(ListLink<T> * & here);
public:
- T operator * () const;
+ T & operator * () const;
ListIterator<T> & operator ++ ();
bool operator != (const ListIterator<T> &) const;
private:
- const List<T> & list;
- size_t index;
+ ListLink<T> * here = nullptr;
+ ListLink<T> * next = nullptr;
};
template <typename T>
class ListRange {
public:
- ListRange(const List<T> & list);
+ ListRange(List<T> & list);
public:
- ListIterator<T> begin() const;
- ListIterator<T> end() const;
+ ListIterator<T> begin();
+ ListIterator<T> end();
size_t size() const;
private:
- const List<T> & list;
+ List<T> & list;
};
#include "ListIterator.hpp"