[Issue 15027] cannot pass arguments of type DirEntry to std.file functions

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Sep 10 23:09:18 PDT 2015


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

--- Comment #2 from Rainer Schuetze <r.sagitario at gmx.de> ---
The workaround might be a little better if you just make a copy of type
StringTypeOf!Range excluding everything but the name string. It doe not work
for aggregates that alias this to some other input range, though.

The main problem is that DirEntry does not qualify as an InputRange, because
the aliased property returns an rvalue. This cannot be passed to popFront
through UFCS as it expectes a ref argument.

Maybe a more general solution is to check whether an AliasThisTypeOf exists and
a saved copy of it can be used as an input range.

--


More information about the Digitalmars-d-bugs mailing list