All pastes #31648 Raw Edit

Unnamed

public text v1 · immutable
#31648 ·published 2005-11-29 03:37 UTC
rendered paste body
template <class Item>
Sequence_2<Item>& 
Sequence_2<Item>::operator = (preserves Sequence_2& rhs)
   // produces self
   // post: self = rhs
{
	if (head == NULL) {
		rhs.head = head;
	} else {
		variable Node p, temp;
		variable Integer i;

		p = head;
		rhs.head = p;
		while (p->next != NULL) {
			p = p->next;
			rhs.Add (i, p->value);
			i++;
		} // end for
		return (rhs);
	} // end if
} // operator =