spir:

> Out[] map (In, Out) (In[] source, Out delegate (In) f) {
>      // (0)
...
>      string hex (uint i) { return format("0x%03X", i); }
>      uint[] decs = [1, 3, 9, 27, 81, 243, 729];
>      auto hexes = map!(uint,string)(decs, &hex);
...
> (0) The func must be declared as delegate (instead of simple func pointer) 
> because: the actual func hex beeing defined in a block, the compiler turns it 
> into a delegate. Detail.

See also:

void foo(In, Out)(Out function(In) f) {}
void main() {
     static int bar(int i) { return 0; }
     foo(&bar);
}

Bye,
bearophile

Reply via email to