void RunCursorList(ifstream& stream){ char iord; int number; //string dummy; //getline(stream, dummy); char dummy[256]; stream.getline(dummy, 256); CursorList<int> list(cursorSpace); CursorListItr<int> listItr = list.zeroth(); while(stream >> iord >> number){ if(iord == 'i'){ list.insert(number, listItr); listItr.advance(); //cout << "Inserted " << number << endl; } else /*if(iord == 'd')*/{ list.remove(number); //cout << "Deleted " << number << endl; } } stream.clear(); stream.seekg(0, ios::beg); }
const CursorList<Object> & CursorList<Object>::operator=( const CursorList<Object> & rhs ) { CursorListItr<Object> ritr = rhs.first( ); CursorListItr<Object> itr = zeroth( ); if( this != &rhs ) { makeEmpty( ); for( ; !ritr.isPastEnd( ); ritr.advance( ), itr.advance( ) ) insert( ritr.retrieve( ), itr ); } return *this; }