Skip to content

Implement LWG-3599 The const overload of lazy_split_view::begin should be constrained by const Pattern#6268

Merged
StephanTLavavej merged 1 commit into
microsoft:mainfrom
frederick-vs-ja:lwg-3599
May 15, 2026
Merged

Implement LWG-3599 The const overload of lazy_split_view::begin should be constrained by const Pattern#6268
StephanTLavavej merged 1 commit into
microsoft:mainfrom
frederick-vs-ja:lwg-3599

Conversation

@frederick-vs-ja
Copy link
Copy Markdown
Contributor

@frederick-vs-ja frederick-vs-ja commented May 4, 2026

Fixes #6202.

Blocked libcxx test(s):

  • std/ranges/range.adaptors/range.lazy.split/begin.pass.cpp

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner May 4, 2026 17:14
Copilot AI review requested due to automatic review settings May 4, 2026 17:14
@github-project-automation github-project-automation Bot moved this to Initial Review in STL Code Reviews May 4, 2026
@frederick-vs-ja frederick-vs-ja changed the title Implement LWG-3599 Implement LWG-3599 The const overload of lazy_split_view::begin should be constrained by const Pattern May 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Implements the LWG-3599 resolution for views::lazy_split by tightening const-overload constraints and adding a regression test.

Changes:

  • Add a new test_lwg_3599() regression test for views::lazy_split.
  • Constrain lazy_split_view::begin() const and the end() const common-range branch on forward_range<const _Pat>.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/std/tests/P0896R4_views_lazy_split/test.cpp Adds a new LWG-3599 regression test exercising lazy_split behavior.
stl/inc/ranges Tightens constraints for lazy_split_view const iteration based on the pattern’s const forward-iterability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/std/tests/P0896R4_views_lazy_split/test.cpp
@StephanTLavavej StephanTLavavej added LWG Library Working Group issue ranges C++20/23 ranges labels May 4, 2026
@StephanTLavavej StephanTLavavej self-assigned this May 8, 2026
Comment on lines +359 to +361
static_assert(ranges::forward_range<remove_cvref_t<decltype(r)>>);
static_assert(!ranges::forward_range<const remove_cvref_t<decltype(r)>>);
static_assert(ranges::forward_range<remove_cvref_t<decltype(f)>>);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change requested: The remove_cvref_ts aren't doing anything because the variables are plain auto, but I suppose this makes it very clear that we don't want any cvref qualifiers.

@StephanTLavavej StephanTLavavej removed their assignment May 14, 2026
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews May 14, 2026
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews May 14, 2026
@StephanTLavavej
Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo. Please notify me if any further changes are pushed, otherwise no action is required.

@StephanTLavavej StephanTLavavej merged commit 4c239c6 into microsoft:main May 15, 2026
49 checks passed
@github-project-automation github-project-automation Bot moved this from Merging to Done in STL Code Reviews May 15, 2026
@StephanTLavavej
Copy link
Copy Markdown
Member

Thanks for improving this lazy kitty! 🐱 💤 🐈

@frederick-vs-ja frederick-vs-ja deleted the lwg-3599 branch May 16, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LWG Library Working Group issue ranges C++20/23 ranges

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

LWG-3599 The const overload of lazy_split_view::begin should be constrained by const Pattern

3 participants