Comment #0 by bearophile_hugs — 2014-11-29T13:19:58Z
I think this doesn't need to allocate heap memory:
void main() @nogc {
import std.algorithm: count;
import std.range: only;
int[] a;
auto r = a.count(only(0, 1));
}
dmd 2.067alpha:
test.d(5,21): Error: @nogc function 'D main' cannot call non-@nogc function 'std.algorithm.count!("a == b", int[], OnlyResult!(int, 1u)).count'