Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2836 R1 std::basic_const_iterator should follow its underlying type's convertibility #1509

Closed
wg21bot opened this issue Apr 11, 2023 · 6 comments · Fixed by cplusplus/draft#6699
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++26 Targeted at C++26 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. ranges std::ranges size - small paper size estimate
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Apr 11, 2023

P2836R0 std::const_iterator often produces an unexpected type (Christopher Di Bella)

@wg21bot wg21bot added LEWG Library Evolution LWG Library SG9 Ranges SG labels Apr 11, 2023
@wg21bot wg21bot added this to the 2023-telecon milestone Apr 11, 2023
@cor3ntin cor3ntin removed the LWG Library label Apr 11, 2023
@brycelelbach brycelelbach added IS Ship vehicle: IS C++26 Targeted at C++26 B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e ranges std::ranges size - small paper size estimate and removed LEWG Library Evolution labels May 24, 2023
@brycelelbach
Copy link

@inbal2l please have ranges look at this first.

@inbal2l
Copy link
Collaborator

inbal2l commented Jun 13, 2023

Was discussed on LEWG Mailing List.

There were 4 modifications proposed in the thread:

  1. Fix const_iterator_t to:
    template
    using const_iterator_t = decltype(ranges::cbegin(declval<R&>()));
  2. Fix const_iterator_t to accept arrays of unknown bound
    (addressing: https://cplusplus.github.io/LWG/issue3913)
  3. Fix basic_const_iterator<int*> is not convertible to int const*
    Adding conversion operators to basic_const_iterator<I> so that it is convertible to any type that I is convertible to.
  4. Proposed in P2836: Fix const_iterator<int*> isn't equivalent to int const*
    Using an associated type such as const_iterator_for and have std::vector::iterator identify that std::vector::const_iterator is its const_iterator counterpart by adding const_iterator_for as a member-alias (ABI implications to all iterators in std).

Option 1 got broad support (including from the paper author) so it will be fixed for C++23 as a library issue.
For the other options more discussion is required, therefor the paper will be scheduled for an LEWG meeting.

@inbal2l inbal2l added LEWG Library Evolution C++23 Targeted at C++23 and removed SG9 Ranges SG C++26 Targeted at C++26 labels Jun 13, 2023
@wg21bot
Copy link
Collaborator Author

wg21bot commented Jul 21, 2023

P2836R1 std::basic_const_iterator should follow its underlying type's convertibility (Christopher Di Bella)

@wg21bot wg21bot changed the title P2836 std::const_iterator often produces an unexpected type P2836 R1 std::basic_const_iterator should follow its underlying type's convertibility Jul 21, 2023
@inbal2l inbal2l added the ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll label Jul 25, 2023
@inbal2l
Copy link
Collaborator

inbal2l commented Jul 25, 2023

The paper was seen in Library Evolution Telecon on 2023-07-11 Full Minutes.

Polls

POLL: Forward D2836R1 to LWG for C++26 and as a DR for C++23 (to be confirmed by electronic poll).

SF F N A SA
10 4 0 0 0

# of Authors: 1

Authors’ position: SF

Attendance: 15

Outcome: Unanimous Consent in favour

Next Steps

The paper was forwarded to LWG for C++26 and as a DR for C++23 (to be confirmed by LEWG electronic poll)

@inbal2l
Copy link
Collaborator

inbal2l commented Sep 15, 2023

P2836R1 was added to LEWG 2023 September electronic poll paper (P2972R0)

@inbal2l inbal2l added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Sep 23, 2023
@inbal2l inbal2l added LWG Library lwg-pending LWG Chair needs to disposition and removed LEWG Library Evolution scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Oct 16, 2023
@inbal2l inbal2l removed the ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll label Oct 16, 2023
@inbal2l
Copy link
Collaborator

inbal2l commented Oct 16, 2023

P2836R1 was forwarded to LWG on LEWG 2023 September electronic poll (P2972R0)

@jensmaurer jensmaurer removed the C++23 Targeted at C++23 label Nov 6, 2023
@inbal2l inbal2l added plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. and removed lwg-pending LWG Chair needs to disposition labels Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++26 Targeted at C++26 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. ranges std::ranges size - small paper size estimate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants