예제 #1
0
파일: LinkedList.cpp 프로젝트: zhwa63/ECS60
        const List<Object> & List<Object>::operator=( const List<Object> & rhs )
        {
            if( this != &rhs )
            {
                makeEmpty( );

                ListItr<Object> ritr = rhs.first( );
                ListItr<Object> itr = zeroth( );
                for( ; !ritr.isPastEnd( ); ritr.advance( ), itr.advance( ) )
                    insert( ritr.retrieve( ), itr );
            }
            return *this;
        }
예제 #2
0
파일: List.cpp 프로젝트: asztell/Cplusplus
const List<Object>& List<Object>::operator =( const List<Object>& rhs ) {
	if (this != &rhs) {
		makeEmpty();

		ListIterator<Object> rightiter = rhs.first( );
		ListIterator<Object> myiterator = zeroth();
		while( rightiter.isValid() ) {
			insert( rightiter.retrieve(), myiterator );
			rightiter.advance();
			myiterator.advance();
		}
	}
	return( *this );
}