#pragma once #include "ListIterator.h" template ListRange::ListRange(List & list) : list(list) { } template ListIterator ListRange::begin() { return { this->list.tail }; } template ListIterator ListRange::end() { return { this->list.head }; } template size_t ListRange::size() const { return this->list.size(); } template ListIterator::ListIterator(ListLink * & here) { this->here = here; if (this->here != nullptr) this->next = this->here->next; } template T & ListIterator::operator * () const { return this->here->value; } template ListIterator & ListIterator::operator ++ () { this->here = this->next; if (this->here != nullptr) this->next = this->here->next; return *this; } template bool ListIterator::operator != (const ListIterator & rhs) const { return this->here != nullptr; }