On Monday, 2 September 2019 at 14:20:11 UTC, Paul Backus wrote:

If you have an existing delegate that you want to use with opApply, the easiest way is like this:

void delegate(Thing) myDelegate = ...;

foreach(thing; things) {
    myDelegate(thing);
}
// Equivalent to: things.opApply((Thing t) => myDelegate(t))

Thanks for your answer. It's not exactly, what I was looking for, but meanwhile I think, the whole idea was not reasonable. I meanwhile returned to using a normal function call instead of opApply, which makes it easy to pass a delegate as one of the parameters.

Reply via email to