3
我想在DLang(指針函數)中使用函數指針,但它不會編譯。所有關於製作函數指針的代碼都不適用於我。這是我的代碼:D2:功能指針不會編譯
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;
};
我在使用dmd2,在Ubuntu上。
[Works](http://dpaste.dzfl.pl/d21fd09780db)。 – sigod