C++11 lambdas
Stefan Schulz
schulz at the-loom.de
Mon Mar 15 04:17:47 PDT 2010
Am 15.03.2010 12:01, schrieb Rémi Forax:
> Le 15/03/2010 08:18, Stefan Schulz a écrit :
>> Object() (a); // an expression lambda
>> Object() a; // a function type declaration
>> Object() {Object a = create(); return a;}; // a block lambda
>> new Object() {Object a = create();}; // an anonymous class
>
> like 3; is not a valid instruction in Java,
> Object() (a); and Object() {Object a = create(); return a;};
> should not compile because they are expression without side effect.
I left out assignments of the statements/expressions, as it could simply
be an "Object o = " in all cases (except function type declaration), if
that is what you meant with side effect.
I just wanted to show how similar they look in syntax, I'm not implying
any judgement on whether that is positive or negative.
Stefan
More information about the lambda-dev
mailing list