Represents an iterator for some type. This is a forward-only iterator in that it can only start at 0 and increment through the items until done. More...
Public Member Functions | |
void | Reset () |
Start iteration from beginning of container. | |
TItemType? | Next () |
Retrieve the next item from the container. | |
Represents an iterator for some type. This is a forward-only iterator in that it can only start at 0 and increment through the items until done.
TItemType | The type of each item provided by the iterator |
var iterator = container.GetItems(); for (var item in iterator.Next(); item != null; item = iterator.Next()) { // Use item here }
A generic type is used in this example so I didn't have to come up with either two iterators (one for ItemPair and the other for string) or one iterator that returned an object that would have to be cast to the appropriate type before using.
Definition at line 51 of file IteratorContainer_Class.cs.
TItemType? Next | ( | ) |
Retrieve the next item from the container.
Implemented in Iterator< TItemType >.
void Reset | ( | ) |
Start iteration from beginning of container.
Implemented in Iterator< TItemType >.