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

Drop findIndirect() algorithm #843

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Conversation

KitsuneRal
Copy link
Member

@KitsuneRal KitsuneRal commented Dec 3, 2024

This retracts the algorithm introduced in #840 #760 - it is unnecessary, as std::ranges::find() can handle it just fine with the current toolchain versions. The algorithm didn't show up in any release so it's safe to remove it. The algorithm was introduced before 0.9 beta but I only found my mistake after this PR was merged. If someone ends up missing it, it can easily be reintroduced as an alias to std::ranges::find.

According to cppreference.com, std::invoke is supposed to deal with one
level of indirection automatically (e.g. if the first parameter is a
smart pointer), so we should not need findIndirect() for that. What
findIndirect() effectively does is enabling the second level of
indirection, and that kind of stuff better be spelled out in the code
instead of being magically consumed by an algorithm.
@KitsuneRal KitsuneRal added the bug/fix The library doesn't work as expected label Dec 3, 2024
@KitsuneRal KitsuneRal merged commit 4c97d1d into dev Dec 4, 2024
11 checks passed
@KitsuneRal KitsuneRal deleted the kitsune/revert-find-indirect branch December 4, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/fix The library doesn't work as expected
Projects
Status: 0.9 - Done
Development

Successfully merging this pull request may close these issues.

1 participant