It's even part of DMD testsuite:
https://github.com/dlang/dmd/blob/38c1bad2f41ad8e6bc7c08deae26e30c9c7d7704/test/runnable/nogc.d#L20

At DConf, Dicebot mention that he had some problems in the past and it
doesn't work in some places. The Weka people seemed to have similar
experience.
I did some experiment and so far the only related issue I've found is
https://issues.dlang.org/show_bug.cgi?id=16037 . If you happen to come
accross a case where it doesn't work, I would very like to be CC'ed on that
issue :)

2016-06-10 0:17 GMT+02:00 Steven Schveighoffer via Digitalmars-d <
digitalmars-d@puremagic.com>:

> On 6/9/16 6:06 PM, Mathias Lang via Digitalmars-d wrote:
>
>> To avoid the delegate being GC allocated, use `scope foo = (int i) { ...
>> }` at call site.
>>
>
> Is that true? At one point in D's past, this ONLY worked if you passed a
> delegate to a function accepting a scope delegate. Maybe it's been fixed.
>
> -Steve
>

Reply via email to