P2278R4: cbegin should always return a constant iterator ("Iterators" section only)#3043
Conversation
std::const_iteratorcbegin 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! |
strega-nil-ms
left a comment
There was a problem hiding this comment.
Other than the minor base() -> _Current thing, looks great!
frederick-vs-ja
left a comment
There was a problem hiding this comment.
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.
| </Type> | ||
|
|
||
|
|
||
| <Type Name="std::basic_const_iterator<*>"> |
There was a problem hiding this comment.
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 -
cbeginshould always return a constant iterator. Towards #2918.