import std.typecons; import std.math; alias double function(double) UNARY; UNARY[] FCNS = [sin, cos, tan]; double[][] MAP (int idx, double[][] args) nothrow { UNARY f = FCNS[idx]; foreach(i; 0 .. args.length) foreach(j; 0 .. args[i].length) args[i][j] = f (args[i][j]); return args; } what's wrong with it?
Absolutely a newbie to D. This code mimics c, but unfortunately
does not work:
- How to make a function table? mnar53 via Digitalmars-d-learn
- Re: How to make a function table? Alex via Digitalmars-d-learn
- Re: How to make a function table? mnar53 via Digitalmars-d-learn