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

LWG-4053 Unary call to std::views::repeat does not decay the argument #4507

Closed
Tracked by #4491
StephanTLavavej opened this issue Mar 23, 2024 · 3 comments · Fixed by #4685
Closed
Tracked by #4491

LWG-4053 Unary call to std::views::repeat does not decay the argument #4507

StephanTLavavej opened this issue Mar 23, 2024 · 3 comments · Fixed by #4685
Labels
fixed Something works now, yay! LWG Library Working Group issue ranges C++20/23 ranges

Comments

@StephanTLavavej
Copy link
Member

LWG-4053 Unary call to std::views::repeat does not decay the argument

@StephanTLavavej StephanTLavavej added LWG Library Working Group issue ranges C++20/23 ranges labels Mar 23, 2024
@leejy12
Copy link
Contributor

leejy12 commented Mar 25, 2024

Is this simple patch in <ranges> enough to fix this issue?

-template <class _Ty, class _Bo>
-repeat_view(_Ty, _Bo) -> repeat_view<_Ty, _Bo>;
+template <class _Ty, class _Bo = unreachable_sentinel_t>
+repeat_view(_Ty, _Bo = _Bo()) -> repeat_view<_Ty, _Bo>;

@frederick-vs-ja
Copy link
Contributor

Is this simple patch in <ranges> enough to fix this issue?

-template <class _Ty, class _Bo>
-repeat_view(_Ty, _Bo) -> repeat_view<_Ty, _Bo>;
+template <class _Ty, class _Bo = unreachable_sentinel_t>
+repeat_view(_Ty, _Bo = _Bo()) -> repeat_view<_Ty, _Bo>;

Yes. But IIUC the resolution of LWG-4053 is only meaningful when using class template argument deduction, because LWG-4054 covers the major concern. It seems that we should test CTAD of repeat_view (test coverage is nearly completely missing), although it's not recommended for user codes to use CTAD with range adaptors.

@StephanTLavavej
Copy link
Member Author

We talked about this at the weekly maintainer meeting and @barcharcraz and I agree that this LWG issue resolution is simple enough that we can just directly implement it, no specific testing needed.

@StephanTLavavej StephanTLavavej moved this to Available in STL LWG Issues Mar 28, 2024
Andor233 added a commit to Andor233/STL that referenced this issue May 22, 2024
Andor233 added a commit to Andor233/STL that referenced this issue May 22, 2024
@github-project-automation github-project-automation bot moved this from Available to Done in STL LWG Issues May 23, 2024
@StephanTLavavej StephanTLavavej added the fixed Something works now, yay! label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Something works now, yay! LWG Library Working Group issue ranges C++20/23 ranges
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants