anonymous function/delegate usage

Sam Hu samhu.samhu at nospam.com
Thu Nov 12 17:00:26 PST 2009


Don Wrote:

> You need to call the delegate you've made.

I missed this key point.

So to summary:
int a=1;
int b=2;
1.nested function;
2.int c=(int a,int b){return a+b;}(a,b);
3.int c=(int,int){return a+b;}(a,b);
4.int c=(){return a+b;}();
5.int c={return a+b;}();

How come the last one is legal?

Thank you all for all your help!


More information about the Digitalmars-d-learn mailing list