Hacker News new | ask | show | jobs
Many C++ lambda idioms seem superfluous
1 points by reportaman 1073 days ago
, meant for nothing more than patching some bad unmaintainable code or perhaps job security of C++ commission.
1 comments

What specific idioms do you have in mind?
Firstly, they seem to be a hack around old unmaintained library code that accepts a callable that cannot be patched to change the callable's argument list. C++'s solution: give them a new callable "lambda" that extends passing new arguments (silently) in capture list ^^. Moreover, the combination of choices [=] mutable, [&], etc: seem like a documentation disaster. The idea that one has to read the body of lambda function to decipher what is getting passed to the lambda is another layer of lazz...