[iterator.concepts.general] (original) (raw)

23 Iterators library [iterators]

23.3 Iterator requirements [iterator.requirements]

23.3.4 Iterator concepts [iterator.concepts]

23.3.4.1 General [iterator.concepts.general]

For a type I, let ITER_­TRAITS(I) denote the type I if iterator_­traits<I> names a specialization generated from the primary template.

Otherwise, ITER_­TRAITS(I) denotesiterator_­traits<I>.

[Note 1:

ITER_­TRAITS enables independent syntactic determination of an iterator's category and concept.

— _end note_]

[Example 1:

struct I { using value_type = int;using difference_type = int;int operator*() const; I& operator++(); I operator++(int); I& operator--(); I operator--(int);bool operator==(I) const;}; iterator_­traits<I>​::​iterator_­category denotes input_­iterator_­tag, and ITER_­CONCEPT(I) denotes random_­access_­iterator_­tag.

— _end example_]