Title
Iterator reachability should not require a container
Status
resolved
Section
[iterator.requirements]
Submitter
Alisdair Meredith

Created on 2009-09-18.00:00:00 last changed 163 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [iterator.requirements], p6:

An iterator j is called reachable from an iterator i if and only if there is a finite sequence of applications of the expression ++i that makes i == j. If j is reachable from i, they refer to the same container.

Date: 2010-10-21.18:28:33

Rationale:

Solved by N3066.

Date: 2010-12-05.00:09:22

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

Date: 2009-09-18.00:00:00

p6 Iterator requirements [iterator.requirements]

An iterator j is called reachable from an iterator i if and only if there is a finite sequence of applications of the expression ++i that makes i == j. If j is reachable from i, they refer to the same container.

A good example would be stream iterators, which do not refer to a container. Typically, the end iterator from a range of stream iterators will compare equal for many such ranges. I suggest striking the second sentence.

An alternative wording might be:

If j is reachable from i, and both i and j are dereferencable iterators, then they refer to the same range.

History
Date User Action Args
2010-12-05 00:09:22adminsetstatus: nad editorial -> resolved
2010-10-21 18:28:33adminsetmessages: + msg1168
2010-10-21 18:28:33adminsetmessages: + msg1167
2010-10-21 18:28:33adminsetmessages: + msg1166
2009-09-18 00:00:00admincreate