-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
P2278R4: cbegin
should always return a constant iterator ("Iterators" section only)
#3043
P2278R4: cbegin
should always return a constant iterator ("Iterators" section only)
#3043
Conversation
std::const_iterator
cbegin
should always return a constant iterator
cbegin
should always return a constant iterator cbegin
should always return a constant iterator ("Iterators" section only)
tests/std/tests/P2278R4_ranges_const_iterator_machinery/test.compile.pass.cpp
Show resolved
Hide resolved
cbfdb9d
to
377c851
Compare
Just curious, does the current implementation pass the following two assertions? using CI = std::basic_const_iterator<int*>;
static_assert(std::sentinel_for<CI, int*>);
static_assert(std::sized_sentinel_for<CI, CI>); |
Nope, it doesn't. There was short discussion on discord about it: https://discord.com/channels/737189251069771789/738835809238646854/1011456843106762892. |
Heads up: I pushed some commits that (1) implement the proposed resolution of LWG-3769, which is intended to correct the constraint recursion in the design, and (2) workaround LLVM-55945 to avoid constraint recursion in practice. |
@JMazurkiewicz is this PR ready to become non-draft now? |
@CaseyCarter yes, it is. And thank you for implementing LWG-3769! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LWG-3765 has been set to Tentatively Ready, so I think it's safe to implement the resolution without comments.
Feel free to do this in a separated PR. I'm not sure whether the constraints should be tested.
This comment was marked as resolved.
This comment was marked as resolved.
@@ -1404,6 +1404,14 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |||
</Type> | |||
|
|||
|
|||
<Type Name="std::basic_const_iterator<*>"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding a visualizer! 😸
Mirroring note: As usual, this will need to be triple-mirrored to the VS repo, but I'm ok with deferring that until the next time we have a decent-sized batch of visualizer updates.
tests/std/tests/P2278R4_ranges_const_iterator_machinery/test.compile.pass.cpp
Outdated
Show resolved
Hide resolved
tests/std/tests/P2278R4_ranges_const_iterator_machinery/test.compile.pass.cpp
Show resolved
Hide resolved
Thanks for implementing this part of the feature! 😻 FYI @strega-nil-ms, I pushed changes after you approved.
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for constantly making the STL better! 😹 😻 😸 |
Implements "Iterators" section from P2278R4 -
cbegin
should always return a constant iterator. Towards #2918.