On Thursday, 18 August 2016 at 00:59:43 UTC, Dicebot wrote:
On 08/18/2016 12:25 AM, Ali Çehreli wrote:
[...]

I believe actual reason is that aliased lambda has to allocate a closure because it refers to stack local variable (limit). This compiles just fine:

auto countAbove(int[] a, int limit) @nogc {
    return a.filter!(x => x >= 1).count();
}

I wish we could have something like "scoped" delegates...

Reply via email to