From 5c34847218e8d754447f5cf71ed595bbb412eee7 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 29 Oct 2024 23:30:57 +0100 Subject: more WIP --- backend/ListIterator.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 backend/ListIterator.h (limited to 'backend/ListIterator.h') 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 + +template +class List; + +template +class ListIterator { +public: + ListIterator(List & list, size_t index); + +public: + T operator * () const; + ListIterator & operator ++ (); + bool operator != (const ListIterator &) const; + +private: + List & list; + size_t index; +}; + +template +class ListRange { +public: + ListRange(List & list); + +public: + ListIterator begin() const; + ListIterator end() const; + size_t size() const; + +private: + List & list; +}; + +#include "ListIterator.hpp" -- cgit v1.2.3