www.digitalmars.com         C & C++   DMDScript  

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

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 puremagic.com
          Reporter: john.loughran.colvin 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[]))

--
Apr 30