by hellofunk · 10y ago · 0 comments
If we talk only about c++ capture lists by value (i.e. [=]), then you could make a case for a more appropriate use of the word "closure" but since many lambdas do more than this, I think the distinction is necessary.
However, even in by-value captures, if you are capturing a pointer by value, the issue remains. So, really it is not a good idea to think of lambdas as closures in the functional sense typically used in other languages.
Remember that C++ is a by value language. Pointers are explicit, fist class and distinct from the pointed to object.
References are werid, though.