template < class Type>
class ArrayIterator
{
public:
ArrayIterator(Array< Type> &t):array(t){init();}
void init(){_loc = 0;}
int operator ++(){return _loc++;}
int operator ++(int){return _loc++;}
Type operator ()()const{return array[_loc];}
Type& operator()(){return array[_loc];}
operator int(){return _loc < array.numberInArray();}
void traverse(ArrayProcess< Type> *);//for simple traversal operations such as print
private:
//progammer only
};
template < class Type>
class ArrayProcess
{
public:
ArrayProcess(){}
virtual void process(int,Type &)=0;
};