Details
Details
- Reviewers
davidedmundson - Group Reviewers
KWin - Commits
- R127:dfe65276b274: Use lambdas instead of std::bind()
Diff Detail
Diff Detail
- Repository
- R127 KWayland
- Branch
- master
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 3950 Build 3968: arc lint + arc unit
Comment Actions
The parentheses are not necessary when a lambda has no arguments.
[something]() { ::: }
can become:
[something] { ::: }
KWin uses both of these from what I've seen. Personally, I prefer the second.
Otherwise, +1 for the change.
Comment Actions
Lambdas are generally faster to compile and execute. std::bind can make code less verbose, but that is not the case here (I'd say that lambdas win on succinctness here).
Well... Qt has quite a few strange guidelines that we don't follow :) (p.s. I'm not against it going in with the parentheses, just making a note)
Comment Actions
https://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-bind.html
std::bind can be hard to read and can result in larger object files and binaries due to type information that will not be produced by equivalent lambdas.