#ifndef ListIter_H
#define ListIter_H

#ifdef GNU
#define std 
#include <iostream.h>
#else
#include <iostream>
#endif

//#include "list.h"
template <class EleType> class Node;
template <class EleType> class List;


////////////////////////////////////////////////////
// CLASS: LISTITER
// A const list iterator class. It is guaranteed not ot modify the
// list in any way.
////////////////////////////////////////////////////

template <class EleType> 
class ListIter{
 private:
  const Node<EleType> * head;
  Node<EleType> * current;
 public:
  //initialize iterator's current node to point to the first valid
  //node in the list, i.e., head->next, since we have a dummy header
  ListIter(const List<EleType> &ll){
    head = ll.Header();
    current = head->next;
  }

  //return current element value
  const EleType Current_Value(){
    return current->element;
  }

  //advance the iterator
  void operator ++ ( ){   // pre-increment
    current = current->next;
  }

  //seen the entire list
  bool Exhausted(){
    return current == head;
  }
};

#endif  


