How to make delegate refer to itself?

Ary Borenszweig ary at esperanto.org.ar
Sat Nov 23 16:11:16 PST 2013


On 11/23/13 7:57 PM, H. S. Teoh wrote:
> void delegate(Event) dg = (Event e) {
> 		if (e == ...)
> 			queue.remove(dg); // NG: Still complains 'dg' isn't defined
> 	};

Split it in declaration and initialization:

void delegate(Event) dg;
dg = (Event e) {
	if (e == ...)
		queue.remove(dg);
};



More information about the Digitalmars-d-learn mailing list