#pragma once #include "ListIterator.h" template ListRange::ListRange(const List & list) : list(list) { } template ListIterator ListRange::begin() const { return { this->list, 0 }; } template ListIterator ListRange::end() const { return { this->list, this->list.size() }; } template size_t ListRange::size() const { return this->list.size(); } template ListIterator::ListIterator(const List & list, size_t index) : list(list), index(index) { } template T ListIterator::operator * () const { return this->list[this->index]; } template ListIterator & ListIterator::operator ++ () { this->index++; return *this; } template bool ListIterator::operator != (const ListIterator & rhs) const { return this->index < rhs.index; }