Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@frederick-vs-ja
Copy link
Contributor

Currently, there're (at least) three bugs in the piecewise_construct_t constructor of repeat_view:

  1. It can be ambiguous with the internal constructor it uses when constructing repeat_view from empty braces.
  2. The internal constructor it uses contains an unqualified call to _Tuple_get, which can cause hard error when used with some ADL-unfriendly types.
  3. It constructs the sentinel with _STD make_from_tuple<_Bo>(_Bound_args), where a std::move cast specified by [range.repeat.view]/5 is missing.

This PR removes the internal constructor and introduces a _Make_box_from_tuple function template that emulates std::make_from_tuple to implement [range.repeat.view]/5 more closely to the standard wording. Namespace-qualification and move are also added.

Fixes #5387.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner April 2, 2025 03:02
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Apr 2, 2025
@StephanTLavavej StephanTLavavej added bug Something isn't working ranges C++20/23 ranges labels Apr 2, 2025
@StephanTLavavej StephanTLavavej self-assigned this Apr 2, 2025
@StephanTLavavej StephanTLavavej removed their assignment Apr 2, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Apr 2, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Apr 9, 2025
@StephanTLavavej StephanTLavavej self-assigned this Apr 9, 2025
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 7385267 into microsoft:main Apr 10, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Apr 10, 2025
@StephanTLavavej
Copy link
Member

🕊️ 🧙 🚧

@frederick-vs-ja frederick-vs-ja deleted the repeat-piecewise branch April 10, 2025 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ranges C++20/23 ranges

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

<ranges>: Cannot construct repeat_view via {piecewise_construct, {}, {}}

2 participants