delegate reference

Saaa empty at needmail.com
Wed Sep 9 12:30:05 PDT 2009


> Hello Saaa,
>
>> How should I do this then?
>
> C c;
> C2 c2 = new C2;
> C3 c3 = new C3;
> c=c2;
>
> auto dg = { return c.method(); };
>
> c=c3;

I actually did it like this before :) Thanks
But like this I need to do the "c is null" checking within the function 
literal.
I'm not sure how these function literals are implemented; will the size of 
the function
have any impact on speed? Or does the compiler handle them like any other 
function and just thinks of a name itself ? 




More information about the Digitalmars-d-learn mailing list