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

<ranges>: Fix the return types and overload resolution of range adaptor closure objects #4211

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Nov 18, 2023

Fixes #4153.

Notes:

  1. IIRC _Pipeline::operator() overloads also need to return decltype(auto) per [range.adaptor.object]/1.
  2. Deleted overloads are needed, see <functional>: Fixes around not_fn #4057 and Perfect forwarding call wrappers need =delete.
  3. There seems to be a bug of MSVC on cv-qualification in constraints, which is reported as DevCom-10519736.
  4. I think we don't need to guard anything for C++23 (but not 100% sure currently) - in C++20 the return types should always be controlled by the implementation and should always be cv-unqualified class types.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner November 18, 2023 17:46
@StephanTLavavej StephanTLavavej added bug Something isn't working ranges C++20/23 ranges labels Nov 19, 2023
@StephanTLavavej StephanTLavavej self-assigned this Nov 19, 2023
@StephanTLavavej StephanTLavavej removed their assignment Nov 28, 2023
@StephanTLavavej
Copy link
Member

Thanks! I think this needs only one maintainer approval (although it's near the limits of my ranges knowledge).

@StephanTLavavej StephanTLavavej self-assigned this Nov 29, 2023
@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 0274d83 into microsoft:main Nov 29, 2023
37 checks passed
@StephanTLavavej
Copy link
Member

Thanks for improving this ranges code! ✨ 🪄 😸

@frederick-vs-ja frederick-vs-ja deleted the raco-return branch November 29, 2023 23:22
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
None yet
Development

Successfully merging this pull request may close these issues.

<ranges>: operator|(_Left&& __l, _Right&& __r) should return decltype(auto)
3 participants