digitalmars.D.bugs - [Issue 13793] New: nogc std.algorithm.count(std.range.only)
- via Digitalmars-d-bugs (25/25) Nov 29 2014 https://issues.dlang.org/show_bug.cgi?id=13793
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: nobody puremagic.com Reporter: bearophile_hugs eml.cc 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' --
Nov 29 2014