#include <SimpleList.h>
template<typename T>
class SimpleList< T >::iterator
Definition at line 213 of file SimpleList.h.
◆ iterator() [1/2]
Construct a new iterator object.
Definition at line 221 of file SimpleList.h.
221 : current(
nullptr) {}
◆ iterator() [2/2]
template<typename T >
SimpleList< T >::iterator::iterator |
( |
Node * |
node | ) |
|
|
inline |
Construct a new iterator object.
- Parameters
-
node | Pointer to the starting node |
Definition at line 228 of file SimpleList.h.
◆ operator!=()
Inequality comparison operator.
- Parameters
-
other | Another iterator to compare with |
- Returns
- true if the iterators are not equal, false otherwise
Definition at line 257 of file SimpleList.h.
257 {
return current != other.current; }
◆ operator*()
Dereference operator.
- Returns
- T& Reference to the data in the current node
Definition at line 235 of file SimpleList.h.
235 {
return current->data; }
◆ operator++()
Prefix increment operator.
- Returns
- iterator& Reference to the incremented iterator
Definition at line 249 of file SimpleList.h.
249 {
if (current) current = current->next;
return *
this; }
◆ operator->()
Arrow operator.
- Returns
- T* Pointer to the data in the current node
Definition at line 242 of file SimpleList.h.
242 {
return ¤t->data; }
◆ operator==()
Equality comparison operator.
- Parameters
-
other | Another iterator to compare with |
- Returns
- true if the iterators are equal, false otherwise
Definition at line 265 of file SimpleList.h.
265 {
return current == other.current; }
The documentation for this class was generated from the following file: