cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : Miscellaneous : iterator : InputIterator
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
Miscellaneous
complex
exception
functional
iterator
limits
locale
memory
new
numeric
stdexcept
typeinfo
utility
valarray
iterator
advance
back_inserter
distance
front_inserter
inserter
iterator
iterator_traits
iterator categories:
· BidirectionalIterator
· ForwardIterator
· InputIterator
· OutputIterator
· RandomAccessIterator
predefined iterators:
· back_insert_iterator
· front_insert_iterator
· insert_iterator
· istreambuf_iterator
· istream_iterator
· ostreambuf_iterator
· ostream_iterator
· reverse_iterator

-

InputIterator
<iterator>

Input iterator category

Input

Input iterators are iterators especially designed for sequential input operations, where each value pointed by the iterator is read only once and then the iterator is incremented.

They have the following characteristics:

characteristicvalid expressions
Can be copied and copy-constructedX b(a);
b = a;
Accepts equality/inequality comparisonsa == b
a != b
Can be dereferenced as an rvalue (when not null).
Each value only needs to be dereferenceable once
(algorithms using InputIterator are single pass algorithms)
*a
a->m
Can be incremented (when not null)++a
a++
*a++
Value type does not need to be assignablet = u not needed
Where X is an 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.

See also

OutputIterator Output iterator category
ForwardIterator Forward iterator category
BidirectionalIterator Bidirectional iterator category
RandomAccessIterator Random-access iterator category
iterator Iterator definitions (header)

Home page | Privacy policy
© cplusplus.com, 2000-2009 - All rights reserved - v2.2
Spotted an error? contact us