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

[libc++] Use forwarding refs for predicates and projections in algorithms helpers #133065

Open
imdj opened this issue Mar 26, 2025 · 1 comment
Open
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@imdj
Copy link
Contributor

imdj commented Mar 26, 2025

Replace lvalue references with forwarding references for predicates and projections in algorithms helpers.

This point has been raised a couple of times in reviews:

Few helper functions already do this:

@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Mar 26, 2025
@ldionne
Copy link
Member

ldionne commented Mar 26, 2025

Or even take by value and then pass around std::reference_wrapper. We should evaluate the pros/cons of each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

3 participants