CONCEPT INPUTITERA(7)

NAME
InputIterator

DESCRIPTION

An input iterator is an iterator that can read through a sequence of values. It is single-pass (old values of the iterator cannot be re-used), and read-only.

An input iterator represents a position in a sequence. Therefore, the iterator can point into the sequence (returning a value when dereferenced and being incrementable), or be off-the-end (and not dereferenceable or incrementable).

REFINEMENT OF

    &#8226; Assignable

    &#8226; DefaultConstructible

    &#8226; EqualityComparable

ASSOCIATED TYPES

    &#8226; value_type

    std::iterator_traits<Iter>::value_type
    The value type of the iterator (not necessarily what *i returns)

    &#8226; difference_type

    std::iterator_traits<Iter>::difference_type
    The difference type of the iterator

    &#8226; category

    std::iterator_traits<Iter>::iterator_category
    The category of the iterator

NOTATION

Iter
    A type playing the role of iterator-type in the InputIterator concept.

i, j
    Objects of type Iter

x
    Object of type value_type

TYPE EXPRESSIONS

Category tag
    category must be derived from std::input_iterator_tag, a model of DefaultConstructible, and a model of CopyConstructible.

Value type copy constructibility
    value_type must be a model of CopyConstructible.

Difference type properties
    difference_type must be a model of SignedInteger.

VALID EXPRESSIONS
Name | Expression | Type | Precondition | Semantics | Postcondition
Dereference | *i | Convertible to value_type | i is incrementable (not off-the-end) |  |
Preincrement | ++i | Iter & | i is incrementable (not off-the-end) |  |
Postincrement | i++ |  | i is incrementable (not off-the-end) | Equivalent to (void)(++i) | i is dereferenceable or off-the-end
Postincrement and dereference | *i++ | Convertible to value_type | i is incrementable (not off-the-end) | Equivalent to {value_type t = *i; ++i; return t;} | i is dereferenceable or off-the-end

COMPLEXITY

All iterator operations must take amortized constant time.

MODELS

    &#8226; std::istream_iterator

SEE ALSO

    &#8226; DefaultConstructible

    &#8226; EqualityComparable

    &#8226; ForwardIterator

    &#8226; OutputIterator