Mysteries of the Underscore

Ron Tarrant rontarrant at gmail.com
Mon Dec 24 11:18:44 UTC 2018


I found a mention that in the definition of a delegate, a 
function parameter and its type could be replaced by an 
underscore:

myTestRig.addOnDestroy(delegate void(Widget w) { quitApp(); } );

became:

myTestRig.addOnDestroy(delegate void(_) { quitApp(); } );

I was trying to find some further documentation on this, but I'm 
coming up empty.

Questions:

1) What is this called (substituting an underscore in this 
manner)?

2) Where can a learn more about it?



More information about the Digitalmars-d-learn mailing list