> > class Foo > { > C* c; > > this(ref C c) > { > this.c = &c; > } > > int invoke() > { > return (*c).method(); > } > } > > void main() > { > // ... > deleg = &(new Foo(c)).invoke; > } > > Or something similar. > > This is dangerous. Do not allow either the Foo instance or the delegate > to survive past the end of c's scope. > > It is simpler and safer to just update the delegate. Thanks!
- delegate reference Saaa
- Re: delegate reference Daniel Keep
- Re: delegate reference Saaa
- Re: delegate reference Ary Borenszweig
- Re: delegate reference Saaa
- Re: delegate reference Daniel Keep
- Re: delegate reference Saaa
- Re: delegate reference BCS
- Re: delegate reference Daniel Keep