toddalina/cs24 — Issue #8: Moving through w/ Iterators
Author: toddalina
Created: 2012-02-03 21:46:04+00:00
State: open

I think it should be possible to move throught the sequence with iterators instead of the current way of doing it by having all of the code in the sequence. If I change it this way, there will be less code in the sequence and everything can be operated through the iterator.

Things that will need to change:
-advance will need to move to the iterator ++ overload. (Inside of advance all we would need would be iterator++)
-remove_current() might need to stay the same. (at least for now.)
-start should be replaced with begin.
-Still need the _head pointer in the sequence class. (unless there is a way to change it so that we don't need it there any more. But it is probably best if we don't move it out of there.)
-current_index would be replaced with the iterator.
-the copy constructor for the sequence is going to have to "create"/initialize a new iterator that points to data in the new sequence and not in the old one.
-insert and attach will have to modify the iterator accordingly.
-current should pull data through the iterator and not through current_index.
-is_item() will need to transition over to being part of the iterator and not part of the sequence class.