Title
Definition of when counted_iterators refer to the same sequence isn't quite right
Status
c++23
Section
[counted.iterator]
Submitter
Tim Song

Created on 2021-04-21.00:00:00 last changed 5 months ago

Messages

Date: 2021-06-07.16:58:04

Proposed resolution:

This wording is relative to N4885.

  1. Modify [counted.iterator] as indicated:

    -3- Two values i1 and i2 of types counted_iterator<I1> and counted_iterator<I2> refer to elements of the same sequence if and only if there exists some integer n such that next(i1.base(), i1.count() + n) and next(i2.base(), i2.count() + n) refer to the same (possibly past-the-end) element.

Date: 2021-06-07.00:00:00

[ 2021-06-07 Approved at June 2021 virtual plenary. Status changed: Voting → WP. ]

Date: 2021-05-15.00:00:00

[ 2021-05-10; Reflector poll ]

Set status to Tentatively Ready after five votes in favour during reflector poll.

Date: 2021-04-21.00:00:00

[counted.iterator]/3 says:

Two values i1 and i2 of types counted_iterator<I1> and counted_iterator<I2> refer to elements of the same sequence if and only if next(i1.base(), i1.count()) and next(i2.base(), i2.count()) refer to the same (possibly past-the-end) element.

However, some users of counted_iterator (such as take_view) don't guarantee that there are count() elements past base(). It seems that we need to rephrase this definition to account for such uses.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2021-06-07 16:58:04adminsetmessages: + msg11908
2021-06-07 16:58:04adminsetstatus: voting -> wp
2021-05-26 21:11:22adminsetstatus: ready -> voting
2021-05-10 16:28:00adminsetmessages: + msg11795
2021-05-10 16:28:00adminsetstatus: new -> ready
2021-04-24 16:05:52adminsetmessages: + msg11781
2021-04-21 00:00:00admincreate