-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Use explicit captures in lambda expressions #13770
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
Use explicit captures in lambda expressions #13770
Conversation
| No more conflicts as of last run. |
f04b97b to
981b52d
Compare
|
Rebased! |
|
I'm -0 on this. Even if this is merged, how could we prevent implicit captures in the future? |
|
@promag What are the best arguments in favour of implicit captures? :-) |
…vial (more than one capture)
|
Tend towards NACK. Sorry to rant, but I'm starting to feel quite strongly about this: If you want to make changes like this, the way to do so is:
Please don't create a PR out of the blue that changes some formerly unheard-of thing in the entire codebase. This creates review work, extra risk, and all massive idempotent code changes all over the code make it harder to keep track of what is actually changing. |
981b52d to
a4def4d
Compare
|
@promag Thanks for reviewing. I've now updated the PR. Implicit captures are now kept for trivial lambdas with only one capture. Explicit captures are used when the capture count is two or above. What do you think? Please re-review :-) |
|
@laanwj Makes sense! Closing this PR |
Use explicit captures in lambda expressions.
Rationale: