[Issue 23621] New: Implicitly convert function to delegate
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jan 11 14:39:11 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23621
Issue ID: 23621
Summary: Implicitly convert function to delegate
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: msnmancini at hotmail.com
```d
import std.stdio;
int add(int delegate() a, int delegate() b){return a()+b();}
int getNumber(){return 50;}
void main()
{
writeln(add(&getNumber, &getNumber));
}
```
This currently does not compile, so it is needed tu wrap
--
More information about the Digitalmars-d-bugs
mailing list