#pragma once #include template class ListRange; template class ListIterator; template struct ListLink { friend class ListIterator; ListLink * prev; ListLink * next; T value; }; template class List { public: List() = default; virtual ~List(); public: size_t size() const; void push_back(const T & el); void remove(const T & val); void pop_back(); void clear(); T & operator [] (size_t index) const; ListIterator begin(); ListIterator end(); ListRange range(); private: friend class ListRange; ListLink * head = nullptr; ListLink * tail = nullptr; size_t length = 0; }; #include "List.hpp"