Can I pass a function by parameter?

AsmMan via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 7 13:47:46 PDT 2014


I'm trying to use a bit of function programming.

In a function like this:

int f(in int[] arr, bool delegate(int) func);

call using:

bool g(int n) { ... }
f(arr, g);

instead of:

f(arr, x => x == 0);

it is possible?


More information about the Digitalmars-d mailing list