#pragma once #include "backend/List.h" #include #include template class List; template class ListIterator { public: // required for compatibility using iterator_category = std::forward_iterator_tag; using value_type = T; using difference_type = std::ptrdiff_t; using pointer = T*; using reference = T&; public: ListIterator(ListLink * & here); public: T & operator * () const; bool operator != (const ListIterator &) const; ListIterator & operator ++ (); bool operator ! () const; private: ListLink * here = nullptr; ListLink * next = nullptr; }; template class ListRange { public: ListRange(List & list); public: ListIterator begin(); ListIterator end(); size_t size() const; private: List & list; }; #include "ListIterator.hpp"