template class List; // required forward declaration template class ListIterator { friend class List; public: ListIterator(); bool hasNext() const; bool hasPrevious() const; T &next() throw ( NoSuchObject ); T &previous() throw ( NoSuchObject ); void set( const T & ); void printInternal() const; private: Node *current; bool atFront, atEnd; }; // ListIterator class