[Issue 18825] New: No syntax for function literal returning a reference
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri May 4 11:49:10 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18825
Issue ID: 18825
Summary: No syntax for function literal returning a reference
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: jl at leroy.nyc
Consider:
int global;
int foo()
{
return global;
}
As per the doc, this is equivalent to:
auto foo = function int() {
return global;
};
But it is not possible to create a function literal equivalent to this:
ref int foo()
{
return global;
}
I tried placing the ref everywhere it makes sense, to no avail.
--
More information about the Digitalmars-d-bugs
mailing list