I want to instantiate a function pointer:
static void GetProc (out function f) {
auto full = demangle(f.mangleof);
auto name = full[full.lastIndexOf('.')+1..$];
f = cast(typeof(f)) GetProcAddress(hModule,name.toStringz);
}
But the compiler won't let me use a function-type variable (out function f). I tried using Object but apparently function is not an Object (how-come??). So, how do I pass a function as ref/out variable (without using template/mixin, which obscures the code and forces me to add many typeof statements...) ?
There is no type called
function. A function must specified the return type and argument type likeint function(double, string). If you want to support any kind of function, use a template