iterator_pattern::Iterator

template<typename T>
class Iterator

Iterator interface for traversing collections.

Defines the methods for sequentially accessing elements.

Subclassed by iterator_pattern::ConcreteIterator< T >

Public Functions

virtual bool hasNext() const = 0

Check if there are more elements in the collection.

Returns:

True if there are more elements, otherwise false.

virtual T next() = 0

Retrieve the next element in the collection.

Throws:

std::out_of_range – if there are no more elements.

Returns:

The next element.