5 ms·
Many C++ lambda idioms seem superfluous
, meant for nothing more than patching some bad unmaintainable code or perhaps job security of C++ commission.
- AnimalMuppet 3y agoWhat specific idioms do you have in mind?
- reportaman 3y agoFirstly, 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...