https://issues.dlang.org/show_bug.cgi?id=13793
Issue ID: 13793
Summary: @nogc std.algorithm.count(std.range.only)
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Keywords: rejects-valid
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: [email protected]
Reporter: [email protected]
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'
--