[Issue 17360] New: std.range.only doesn't allow ref access

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Apr 30 00:13:42 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17360

          Issue ID: 17360
           Summary: std.range.only doesn't allow ref access
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: john.loughran.colvin at gmail.com

This a pain because it means things like this don't work:

int[] a = [1,2,3];
only(a).front.popFront();

Error: template std.range.primitives.popFront cannot deduce function from
argument types !()(int[]), candidates are:
std/range/primitives.d(2084):        std.range.primitives.popFront(T)(ref T[]
a) if (!isNarrowString!(T[]) && !is(T[] == void[]))
std/range/primitives.d(2107):        std.range.primitives.popFront(C)(ref C[]
str) if (isNarrowString!(C[]))

--


More information about the Digitalmars-d-bugs mailing list