CppCoreGuidelines
CppCoreGuidelines copied to clipboard
Add rule about preferring lambdas to std::bind
Currently the guidelines only mention this in the unclassified proto-rules section.
And speaking of std::bind, Stephen T. Lavavej criticizes it so much I’m starting to wonder if it is indeed going to fade away in future. Should lambdas be recommended instead?
But Herb Sutter[1] and Scott Meyers[2] agree std::bind should be avoided, so perhaps a rule on the matter is in order.
[1] https://github.com/isocpp/CppCoreGuidelines/issues/811#issuecomment-299991479 [2] Effective Modern C++ Item 34: Prefer lambdas to std::bind
Yes, I am on the hook to do all of #811 but feel free to put a PR in for this one.