C++ named requirements: LegacyInputIterator
A LegacyInputIterator is a LegacyIterator that can read from the pointed-to element.
LegacyInputIterators only guarantee validity for single pass algorithms: once a LegacyInputIterator i has been incremented,
all copies of its previous value may be invalidated.
Requirements
The type It satisfies LegacyInputIterator if
- The type It satisfies LegacyIterator
- The type It satisfies EqualityComparable
And, given
iandj, values of type It or const Itr, an lvalue of type Itreference, the type denoted bystd::iterator_traits<It>::referencevalue_type, the type denoted bystd::iterator_traits<It>::value_type
The following expressions must be valid and have their specified effects:
| Expression | Return type | 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: i is dereferenceable. The expression (void)*i, *i is equivalent to *i. |
i->m | (*i).m | Precondition: i is dereferenceable. | |
++r | It& | Precondition: r is dereferenceable. Postcondition: r is dereferenceable or r is past-the-end. Postcondition: Any copies of the previous value of r are no longer required to be either dereferenceable or to be in the domain of ==. | |
(void)r++ | (void)++r | ||
*r++ | convertible to value_type | value_type x = *r; |