#ifndef LISTITERATOR_H
#define LISTITERATOR_H
#include "list.h"
template<class T>
class ListIterator
{
public:
  ListIterator(const list<T>& l):_list(&l),_current(0){ }
 T* current() const{if (_current == 0) return 0; else return _current->val; }
 bool next(){if(_list->number == 0) return false;
              if(_current == 0){
                _current = _list->head;return true;}
                else{
                _current = _current->next;
                 if(_current != 0)return true;
                  else {return false;}
                
               }
 }
 void rewind(){_current=0; }
//private:
 const list<T> * _list;
 list<T>::Nodo* _current;
};
#endif
