2578. Iterator requirements should reference iterator traits

Section: 25.3 [iterator.requirements], [iterator.traits] Status: C++17 Submitter: Ville Voutilainen Opened: 2016-01-05 Last modified: 2017-09-07 13:59:44 UTC

Priority: 3

View all other issues in [iterator.requirements].

View all issues with C++17 status.


See this reflector discussion for background.

25.3 [iterator.requirements] attempts to establish requirements for iterators, but [iterator.traits]/1 establishes further requirements that must be met in order to author a portable iterator that works with existing implementations. Failing to meet the requirements of the latter will fail to work in practice. The former requirements should reference the latter, normatively.

[2016-08-03 Chicago]

Fri AM: Moved to Tentatively Ready

Proposed resolution:

After [iterator.requirements.general]/5, insert the following new paragraph:

-?- In addition to the requirements in this sub-clause, the nested typedef-names specified in ([iterator.traits]) shall be provided for the iterator type. [Note: Either the iterator type must provide the typedef-names directly (in which case iterator_traits pick them up automatically), or an iterator_traits specialization must provide them. -end note]