Section: 27.2 [iterator.requirements], 26.2 [container.requirements] Status: NAD Editorial Submitter: Andy Koenig Opened: 2003-12-16 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [iterator.requirements].
View all issues with NAD Editorial status.
What requirements does the standard place on equality comparisons between iterators that refer to elements of different containers. For example, if v1 and v2 are empty vectors, is v1.end() == v2.end() allowed to yield true? Is it allowed to throw an exception?
The standard appears to be silent on both questions.
[Sydney: The intention is that comparing two iterators from different containers is undefined, but it's not clear if we say that, or even whether it's something we should be saying in clause 23 or in clause 24. Intuitively we might want to say that equality is defined only if one iterator is reachable from another, but figuring out how to say it in any sensible way is a bit tricky: reachability is defined in terms of equality, so we can't also define equality in terms of reachability. ]
[ 2009-07 Frankfurt ]
Daniel volunteered to work on this.
[ 2009-09-20 Daniel provided wording. ]
[ 2009-10 Santa Cruz: ]
Leave as Open. Alisdair has volunteered to refine the wording.
[ 2010 Pittsburgh: Moved to NAD Editorial. Rationale added below. ]
Solved by N3066.
Insert a new paragraph between 27.2 [iterator.requirements]/7+8:
[..] The result of the application of functions in the library to invalid ranges is undefined.