| | | | | |

Iterator operator ++()

  • Follow currLink to next link using nextLink field
template <typename T>
listiterator<T>& listiterator<T>::operator ++()
{
  currLink = (*currLink).nextLink;
  return *this;
}

// alternate:

template <typename T>
listiterator<T>& listiterator<T>::operator ++()
{
  currLink = currLink -> nextLink;
  return *this;
}
List image

| | Top of Page | 8. A Generic List Class and Linked Lists - 14 of 19