I'm trying to use function pointers in DLang (Pointer to function), but it wont compile. All the code on the web on making function pointers, doesn't work for me. This is my code:
tqvar function(tqlist)[string] procs;
procs["divide"] = ÷/// cannot implicitly convert expression (&this.divide) of type tqvar delegate(tqlist args) to tqvar function(tqlist) (QScript)
tqvar divide(tqlist args){
tqvar result;
result.ii = true;
result.d = args.read(0).d/args.read(1).d;
return result;
};
I'm using dmd2, on ubuntu.