#ifndef CMSC202_LIST_H #define CMSC202_LIST_H #include // Forward declaration of List class List; class ListNode { private: ListNode * _next; int _data; ListNode(int x, ListNode * next) : _next(next), _data(x) {} friend class List; }; class List { public: List(); ~List(); List(const List &); List & operator =(const List &); bool insert(int); void remove(); bool isEmpty(); bool isPastEnd(); void next(); void previous(); int current(); void reset(); private: ListNode * _head; ListNode * _current; ListNode * _findPrevious(ListNode *); void _destroyList(ListNode *); friend ostream & operator <<(ostream &, List &); }; ostream & operator <<(ostream & os, List & l); #endif