[Issue 19077] New: DirIterator cannot be used as range

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 11 17:56:31 UTC 2018


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

          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 at puremagic.com
          Reporter: contact at szabobogdan.com

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

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:
/usr/include/dmd/phobos/std/algorithm/iteration.d(457,1):       
std.algorithm.iteration.map(fun...) if (fun.length >= 1)

--


More information about the Digitalmars-d-bugs mailing list