Delegate / Error: cannot implicitly convert expression...

Robert M. Münch robert.muench at saphirion.com
Sat Jun 15 15:54:00 UTC 2019


Why does the follwing code give: Error: cannot implicitly convert 
expression & myFunc of type void function(int a) to void delegate(int)


void myFunc(int a){return;}

void main()
{
    void delegate(int) dg;
    dg = &myFunc;
}

See: https://run.dlang.io/is/iTYo2L

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list