aboutsummaryrefslogtreecommitdiff
path: root/backend/ListIterator.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-29 23:30:57 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-29 23:30:57 +0100
commit5c34847218e8d754447f5cf71ed595bbb412eee7 (patch)
tree2872948e6d2f566dd66cb1a9b2a5d9900db4c44f /backend/ListIterator.h
parenta04cb74fee079e3ee43ae5fae32fc2674409822c (diff)
more WIP
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"