template<class I, class T>
class elm::InplacePreIterator< I, T >
As PreIterator, this class is an helper in the writing of iterators but instead of returning the iterated items, it returns a constant reference to the iterated items.
Its aims to avoid redefining all iterator operators each time an operator is defined. The user of this class has just to define four methods:
- bool ended() const – that returns true when the iteration ends,
- bool equals(const Iterator& i) const – to test if two iterators are equal,
- void next() – to move to the next item,
- const T& item() const – to get the current item (if any).
Using these 4 functions, PreIterator is able to support the operators (), !, ++ (prefix), ++ (suffix), *, ->, == and !=.
- Parameters
-
I | Type of the defined iterator. |
T | Type of the items. |
- Deprecated:
- Used PreIterator with reference/non-reference item type.