Skip to content

Conversation

SuperWig
Copy link
Contributor

@SuperWig SuperWig commented Dec 6, 2022

Fixes #2913.

I hope I'm doing the unwrapping, re-unwrapping stuff correctly.

@SuperWig SuperWig requested a review from a team as a code owner December 6, 2022 13:46
@StephanTLavavej StephanTLavavej added ranges C++20/23 ranges cxx23 C++23 feature labels Dec 6, 2022
SuperWig and others added 7 commits December 9, 2022 09:42
For find_last and find_last_if, this transformation is easy - add additional values with a `.second` component of `1729`, which allows us to verify that we always find the last one.

The find_last_if_not test was following the existing find_if_not test, but that's difficult to adapt to "make sure we find the last one". So I've simply taken the find_last_if test and inverted the predicates - not not cat is cat.
Copy link
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

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

Other than the auto and the DRY change, looks really good!

@StephanTLavavej StephanTLavavej self-assigned this Dec 15, 2022
@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 f1e026f into microsoft:main Dec 15, 2022
@StephanTLavavej
Copy link
Member

Thanks for implementing these ranges algorithms! 🐱 🐈 🐈‍⬛ 😻

@SuperWig SuperWig deleted the find_last branch December 19, 2022 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx23 C++23 feature ranges C++20/23 ranges
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P1223R5 ranges::find_last, ranges::find_last_if, ranges::find_last_if_not
5 participants