Use explicit captures in lambda expressions.
Rationale:
- Explicit is better than implicit.
- Help avoid the lambda dangling reference problem (UB) by being explicit with what objects we use. Makes it easier to reason about their lifetimes.
Use explicit captures in lambda expressions.
Rationale:
<!--e57a25ab6845829454e8d69fc972939a-->No more conflicts as of last run.
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? :-)
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.
@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