Many C++ lambda idioms seem superfluous

1 points by reportaman ↗ HN
, meant for nothing more than patching some bad unmaintainable code or perhaps job security of C++ commission.

2 comments

[ 0.23 ms ] story [ 17.3 ms ] thread
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...