#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(); List(const List &) = delete; List(List &&) = delete; List & operator = (const List &) = delete; List & operator = (List &&) = delete; 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"