C++ Iterator Library - input_iterator_tag



Description

It is used to identify the category of an iterator as an input iterator and all input iterators support at least one the following operations.

C++98

property valid expressions
It is a copy-constructible, copy-assignable and destructible

X b(a);

b = a;

It can be compared for equivalence using the equality/inequality operators

(meaningful if both iterators are be in domain).

a == b

a != b

It can be dereferenced as an rvalue (if in a dereferenceable state).

*a

a->m

It can be incremented (if in a dereferenceable state).

The result is either also dereferenceable or a past-the-end iterator.

The previous iterator value is not required to be dereferenceable after the increase.

++a

(void)a++

*a++

Its value type does not need to be assignable t = u not required

C++11

property valid expressions
It is a copy-constructible, copy-assignable and destructible

X b(a);

b = a;

It can be compared for equivalence using the equality/inequality operators

(meaningful if both iterators are be in domain).

a == b

a != b

It can be dereferenced as an rvalue (if in a dereferenceable state).

*a

a->m

It can be incremented (if in a dereferenceable state).

The result is either also dereferenceable or a past-the-end iterator.

The previous iterator value is not required to be dereferenceable after the increase.

++a

(void)a++

*a++

Its value type does not need to be assignable t = u not required
Lvalues are swappable. swap(a,b)

Declaration

Following is the declaration for std::input_iterator_tag.

C++11

struct input_iterator_tag {};
iterator.htm
Advertisements