www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19077] New: DirIterator cannot be used as range


          Issue ID: 19077
           Summary: DirIterator cannot be used as range
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: contact szabobogdan.com

`std.file.dirEntries` should return an input range, but this code does not

auto range = dirEntries("files/", SpanMode.depth)
        .map(a => a);

Error: template std.algorithm.iteration.map cannot deduce function from
argument types !()(DirIterator, void), candidates are:
std.algorithm.iteration.map(fun...) if (fun.length >= 1)

Jul 11 2018