The following program runs correctly
import std.stdio;
int afunction(int x){return x;};
void main()
{
alias myint = int;
myint i=5;
alias tfunction = int function(int);
tfunction f = & afunction;
writeln(f(1));
}
This does not:
import std.stdio;
void main()
{
int afunction(int x){return x;};
alias myint = int;
myint i=5;
alias tfunction = int function(int);
tfunction f = & afunction;
writeln(f(1));
}
It gives compile error :
Error: cannot implicitly convert expression &afunction of type int delegate(int x) pure nothrow @nogc @safe to int function(int)