#ifndef T_ITERATORH #define T_ITERATORH #include using namespace std; //T must be copy constructable (line 13), incrementable (line 16), //and equality comparable (line 25). template class t_iterator: public iterator { T t; public: t_iterator(const T& initial_t = T()): t(initial_t) {} const T& operator*() const {return t;} t_iterator& operator++() {++t; return *this;} const t_iterator operator++(int) { const t_iterator old = *this; ++*this; return old; } friend bool operator==(const t_iterator& it1, const t_iterator& it2) { return it1.t == it2.t; } }; template inline bool operator!=(const t_iterator& it1, const t_iterator& it2) { return !(it1 == it2); } #endif