Class

CGAL::Counting_iterator<Iterator, Value>

Definition

The iterator adaptor Counting_iterator<Iterator, Value> adds a counter to the internal iterator of type Iterator and defines equality of two instances in terms of this counter. It can be used to create finite sequences of possibly infinite sequences of values from input iterators.

#include <CGAL/iterator.h>

Is Model for the Concepts

InputIterator

Requirements

Iterator is a model for InputIterator.

Creation

Counting_iterator<Iterator, Value> i ( std::size_t n = 0);
initializes the internal counter to n and i has a singular value.


Counting_iterator<Iterator, Value> i ( Iterator j, std::size_t n = 0);
initializes the internal counter to n and i to j.

See Also

CGAL::copy_n