semf
|
Implementation of a bidirectional constant iterator for LinkedList
.
More...
#include <linkedlist.h>
Public Types | |
using | iterator_category = std::bidirectional_iterator_tag |
using | value_type = T |
using | difference_type = std::ptrdiff_t |
using | pointer = T * |
using | refernce = T & |
Public Member Functions | |
ConstIterator ()=default | |
ConstIterator (const T *element) | |
Constructor with member variable initialization. More... | |
ConstIterator (const Iterator &iterator) | |
Copy constructor. More... | |
virtual | ~ConstIterator ()=default |
const T & | operator* () const |
Returns the reference of the element the iterator's position. More... | |
const T * | operator-> () const |
Returns the pointer into the element the iterator's position. More... | |
ConstIterator & | operator++ () |
Iterates to the next element in the list. More... | |
ConstIterator | operator++ (int) |
Iterates to the next element in the list. More... | |
ConstIterator & | operator-- () |
Iterates to the previous element in the list. More... | |
ConstIterator | operator-- (int) |
Iterates to the previous element in the list. More... | |
bool | operator== (const ConstIterator &other) const |
Compares this element with that element. More... | |
bool | operator!= (const ConstIterator &other) const |
Compares this element with that element. More... | |
Implementation of a bidirectional constant iterator for LinkedList
.
Definition at line 230 of file linkedlist.h.
using semf::LinkedList< T >::ConstIterator::difference_type = std::ptrdiff_t |
Definition at line 235 of file linkedlist.h.
using semf::LinkedList< T >::ConstIterator::iterator_category = std::bidirectional_iterator_tag |
Definition at line 233 of file linkedlist.h.
using semf::LinkedList< T >::ConstIterator::pointer = T* |
Definition at line 236 of file linkedlist.h.
using semf::LinkedList< T >::ConstIterator::refernce = T& |
Definition at line 237 of file linkedlist.h.
using semf::LinkedList< T >::ConstIterator::value_type = T |
Definition at line 234 of file linkedlist.h.
|
default |
|
inlineexplicit |
Constructor with member variable initialization.
element | Pointer to the element starting iterating. |
Definition at line 244 of file linkedlist.h.
|
inlineexplicit |
Copy constructor.
iterator | iterator to copy from. |
Definition at line 252 of file linkedlist.h.
|
virtualdefault |
|
inline |
Compares this
element with that
element.
other | Iterator to compare. |
true
for both iterators are different elements; false
for both iterators are the same element. Definition at line 340 of file linkedlist.h.
|
inline |
Returns the reference of the element the iterator's position.
LinkedList::end
) leads to undefined behavior. Definition at line 264 of file linkedlist.h.
|
inline |
Iterates to the next element in the list.
LinkedList::end
) leads to undefined behavior. Definition at line 284 of file linkedlist.h.
|
inline |
Iterates to the next element in the list.
LinkedList::end
) leads to undefined behavior. this
. Definition at line 295 of file linkedlist.h.
|
inline |
Iterates to the previous element in the list.
LinkedList::end
) leads to undefined behavior. Definition at line 307 of file linkedlist.h.
|
inline |
Iterates to the previous element in the list.
LinkedList::end
) leads to undefined behavior. this
. Definition at line 318 of file linkedlist.h.
|
inline |
Returns the pointer into the element the iterator's position.
LinkedList::end
) leads to undefined behavior. Definition at line 274 of file linkedlist.h.
|
inline |
Compares this
element with that
element.
other | Iterator to compare. |
true
for both iterator's position is the same element; false
for both iterator's position are different elements. Definition at line 330 of file linkedlist.h.