Class CompatIterator

Inheritance graph
Iterator CompatIterator

class CompatIterator
Description

Wrapper for iterators implementing the Pike 8.0 and earlier iterator API (8.0::Iterator). Used transparently by get_iterator() to provide an iterator suitable for foreach().

Note

This class provides only those functions that are required by the iterator API. It does not proxy any other functions.

See also

get_iterator(), 8.0::Iterator


Inherit Iterator

inherit Iterator : Iterator


Method create

CompatIterator CompatIterator(Iterator old_style_iterator)

Description

Wrap old_style_iterator, which must implement the Pike 8.0 and earlier iterator API (ie lfun::`!(), and either lfun::_iterator_next() or lfun::`+=(), together with lfun::_iterator_index() and lfun::_iterator_value()).

Throws

Throws an error if old_style_iterator doesn't implement the required API.