Implicit conversion by return

Hakan Aras hakan.aras at live.at
Wed Aug 8 08:15:16 UTC 2018


Given this:

struct Num
{
     this(int a) {}
}

Is there any reason why this works:

Num n = 5;

but this doesnt:

Num funk()
{
     return 5;
}


I understand that I can construct it explicitely, but that gets 
annoying quickly, especially with templates.


More information about the Digitalmars-d-learn mailing list