1185. Iterator categories and output iterators

Section: 25.3 [iterator.requirements] Status: Resolved Submitter: Alisdair Meredith Opened: 2009-07-31 Last modified: 2016-01-28 10:19:27 UTC

Priority: Not Prioritized

View all other issues in [iterator.requirements].

View all issues with Resolved status.


(wording relative to N2723 pending new working paper)

According to p3 25.3 [iterator.requirements], Forward iterators, Bidirectional iterators and Random Access iterators all satisfy the requirements for an Output iterator:

XXX iterators satisfy all the requirements of the input and output iterators and can be used whenever either kind is specified ...

Meanwhile, p4 goes on to contradict this:

Besides its category, a forward, bidirectional, or random access iterator can also be mutable or constant...

... Constant iterators do not satisfy the requirements for output iterators

The latter seems to be the overriding concern, as the iterator tag hierarchy does not define forward_iterator_tag as multiply derived from both input_iterator_tag and output_iterator_tag.

The work on concepts for iterators showed us that output iterator really is fundamentally a second dimension to the iterator categories, rather than part of the linear input -> forward -> bidirectional -> random-access sequence. It would be good to clear up these words to reflect that, and separately list output iterator requirements in the requires clauses for the appropriate algorithms and operations.

[ 2010 Pittsburgh: Moved to NAD EditorialResolved. Rationale added below. ]


Solved by N3066.

Proposed resolution: