
David Abrahams <dave@boost-consulting.com> writes: | > | > transform(v.begin(), v.vend(), v.begin() | > | > (auto x) ((int y) auto { return y + x; }) (i)); | > | > | > | | > | | > | Yes, but this is a quite complex and hard to read way to express | > | something simpler. | | Yeah, the corresponding lambda in Python is: | | labmbda x,y: x+y | | It'd be nice if we could get to something that simple. Yes, and it is one the simplest common cases. The correspnding formulation in C++ would be as simple as well, e.g. (auto x, auto y) { x + y; } (three months ago, Bjarne showed another candidate: { x, y; | x + y; }) The main issue in this discussion, however, concerns what to do when a reference is made to an automatic variable in an enclosing scope. -- Gaby