Public Methods | |
iterator () | |
iterator (const iterator &iter) | |
T & | operator * () |
iterator & | operator++ () |
iterator | operator++ (int) |
iterator | operator+ (int inc) |
iterator & | operator-- () |
iterator | operator-- (int) |
iterator | operator- (int inc) |
iterator & | operator= (const iterator &iter) |
bool | operator== (const iterator &iter) |
bool | operator!= (const iterator &iter) |
The iterator is used to iterate over the elements of a list. The iterator at each moment is pointing to an element in the list. Example of usage:
LinkedList<int> list; LinkedList<int>::iterator iter; int val; for (iter=list.begin(); iter!=list.end(); iter++) { // iterating over the elements val = (int)(*iter); // extracting the value . . . }
|
Default constructor. Initializes the iterator to point to nothing. |
|
Copy constructor. Initializes the iterator to point at the same element as iter
|
|
Returns the value of the element pointed to by this iterator.
|
|
Compares the 2 iterators (by the elements they're pointing to.
|
|
Updates the iterator to more forward inc elements in the list (postfix operator).
|
|
Updates the iterator to point on the next list element (postfix operator).
|
|
Updates the iterator to point on the next list element (prefix operator).
|
|
Updates the iterator to more backwards inc elements in the list (postfix operator).
|
|
Updates the iterator to point on the previous list element (postfix operator).
|
|
Updates the iterator to point on the previous list element (prefix operator).
|
|
Updates the current iterator to point to the same element pointed by the given iterator.
|
|
Compares the 2 iterators (by the elements they're pointing to.
|