DIP 1016--ref T accepts r-values--Formal Assessment
Dennis
dkorpel at gmail.com
Fri Feb 8 23:34:47 UTC 2019
On Friday, 8 February 2019 at 23:02:34 UTC, Nicholas Wilson wrote:
> Immediately called lamdas are always inlined.
```
extern(C) void main() {
int a = (() => 1)();
}
```
dmd -inline -O -release -betterC
asm:
```
main:
push RBP
mov RBP,RSP
call qword ptr pure nothrow @nogc @safe int
onlineapp.main().__lambda1()@GOTPCREL[RIP]
xor EAX,EAX
pop RBP
ret
```
https://run.dlang.io/is/lZW9B6
Still a lambda call :/
More information about the Digitalmars-d-announce
mailing list