aboutsummaryrefslogtreecommitdiff
path: root/backend/ListIterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'backend/ListIterator.h')
-rw-r--r--backend/ListIterator.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/backend/ListIterator.h b/backend/ListIterator.h
new file mode 100644
index 0000000..aa78931
--- /dev/null
+++ b/backend/ListIterator.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include "backend/List.h"
+#include <cstddef>
+
+template <typename T>
+class List;
+
+template <typename T>
+class ListIterator {
+public:
+ ListIterator(List<T> & list, size_t index);
+
+public:
+ T operator * () const;
+ ListIterator<T> & operator ++ ();
+ bool operator != (const ListIterator<T> &) const;
+
+private:
+ List<T> & list;
+ size_t index;
+};
+
+template <typename T>
+class ListRange {
+public:
+ ListRange(List<T> & list);
+
+public:
+ ListIterator<T> begin() const;
+ ListIterator<T> end() const;
+ size_t size() const;
+
+private:
+ List<T> & list;
+};
+
+#include "ListIterator.hpp"