An InputIterator
is an Iterator
that can read from the pointed-to element. InputIterator
s only guarantee validity for single pass algorithms: once an InputIterator
i
has been incremented, all copies of its previous value may be invalidated.
Requirements
The type It
satisfies InputIterator
if.
- The type
It
satisfiesIterator
- The type
It
satisfiesEqualityComparable
And, given.
-
i
andj
, values of typeIt
orconst It
-
reference
, the type denoted bystd::iterator_traits<It>::reference
-
value_type
, the type denoted bystd::iterator_traits<It>::value_type
The following expressions must be valid and have their specified effects.
Expression | Return | Equivalent expression | Notes |
---|---|---|---|
i != j | contextually convertible to bool | !(i == j) | Precondition: (i, j) is in the domain of == . |
*i | reference , convertible to value_type | If i == j and (i, j) is in the domain of == then this is equivalent to *j . | Precondition: The expression |
i->m | (*i).m | Precondition: i is dereferenceable. | |
++i | It& | Precondition: Postcondition: Postcondition: Any copies of the previous value of | |
(void)i++ | (void)++i | ||
*i++ | convertible to value_type | value_type x = *i; ++i; return x; |
Note, "in the domain of ==
" means equality comparison is defined between the two iterator values. For input iterators, equality comparison does not need to be defined for all values, and the set of the values in the domain of ==
may change over time.
Please login to continue.