https://issues.dlang.org/show_bug.cgi?id=15027
--- Comment #5 from Walter Bright <[email protected]> --- I thought about this for quite a while. The bottom line is DirEntry is being too clever in using alias this to wrap a string, and should simply stick with DirEntry.name when the name is desired. Rationale: An InputRange, by its very nature, consumes its input. If DirEntry were made into an InputRange, then it would consume the name and eventually the name string will be empty. DirEntry's alias this is returning a copy of its data, meaning that even if it compiled as an InputRange, the popFront would never advance, as it would keep getting reset every time. So, the solution can only be one of: 1. DirEntry is an InputRange. 2. DirEntry is converted to an InputRange before passing to isDir(). The trouble with (1) is that DirEntry then becomes consumed, which would be surprising behavior. (2) can be accomplished by not using alias this, but just using de.name() directly. Or, (2) can be accomplished by overloading isDir() to accept string arguments. But this implies adding an overload to every function that accepts an InputRange. This is out of the question. Leaving us with rewriting isDir(de) to isDir(de.name). That seems to be the most practical solution. --
