<div dir="ltr">It's even part of DMD testsuite: <a href="https://github.com/dlang/dmd/blob/38c1bad2f41ad8e6bc7c08deae26e30c9c7d7704/test/runnable/nogc.d#L20">https://github.com/dlang/dmd/blob/38c1bad2f41ad8e6bc7c08deae26e30c9c7d7704/test/runnable/nogc.d#L20</a><br><br>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.<br>I did some experiment and so far the only related issue I've found is <a href="https://issues.dlang.org/show_bug.cgi?id=16037">https://issues.dlang.org/show_bug.cgi?id=16037</a> . If you happen to come accross a case where it doesn't work, I would very like to be CC'ed on that issue :)<br><div class="gmail_extra"><br><div class="gmail_quote">2016-06-10 0:17 GMT+02:00 Steven Schveighoffer via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="">On 6/9/16 6:06 PM, Mathias Lang via Digitalmars-d wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
To avoid the delegate being GC allocated, use `scope foo = (int i) { ...<br>
}` at call site.<br>
</blockquote>
<br></span>
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.<br>
<br>
-Steve<br>
</blockquote></div><br></div></div>