A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/InputIterator below:

class

<iterator>

std::input_iterator_tag
struct input_iterator_tag {};

Input iterator category

Empty class to identify the category of an iterator as an input iterator:

Input iterators


Input iterators are iterators that can be used in sequential input operations, where each value pointed by the iterator is read only once and then the iterator is incremented.

All forward, bidirectional and random-access iterators are also valid input iterators.

There is not a single type of input iterator: Each container may define its own specific iterator type able to iterate through it and access its elements. But all input iterators support -at least- the following operations:

property valid expressions Is copy-constructible, copy-assignable and destructible X b(a);
b = a;
Can be compared for equivalence using the equality/inequality operators
(meaningful if both iterators are be in domain). a == b
a != b
Can be dereferenced as an rvalue (if in a dereferenceable state). *a
a->m
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 property valid expressions Is copy-constructible, copy-assignable and destructible X b(a);
b = a;
Can be compared for equivalence using the equality/inequality operators
(meaningful if both iterators are be in domain). a == b
a != b
Can be dereferenced as an rvalue (if in a dereferenceable state). *a
a->m
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)


Where X is an input iterator type, a and b are objects of this iterator type, and t and u are objects of the type pointed by the iterator type.

Algorithms requiring input iterators should be single-pass input algorithms: algorithms pass through an iterator position once at most.



See also
output_iterator_tag
Output iterator category (class)
forward_iterator_tag
Forward iterator category (class)
bidirectional_iterator_tag
Bidirectional iterator category (class)
random_access_iterator_tag
Random-access iterator category (class)
iterator
Iterator base class (class template)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4