Comment #0 by verylonglogin.reg — 2013-11-25T06:38:51Z
According to specs "`in` equivalent to `const scope`" but the following code allocates a closure:
---
import std.stdio;
// change direction to `scope` to leave `i` on stack
void f(in void delegate() del)
{ del(); }
void main()
{
int i, j;
writeln(&j); // show stack address
f(() => writeln(&i)); // `i` is on heap
}
---
Comment #1 by robert.schadek — 2024-12-13T18:14:21Z