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

--- Comment #16 from Rainer Schuetze <[email protected]> ---
Here is a version that overloads structs with alias this to a string range by
reference, avoiding the copy problem:

auto isDir(Range)(Range input)
    if (isForwardRange!Range && isSomeChar!(ElementEncodingType!Range))
{
    //...
}

auto isDir(Range)(ref Range input)
    if (!(isForwardRange!Range && isSomeChar!(ElementEncodingType!Range))
        && is(StringTypeOf!Range))
{
    return isDir(cast(StringTypeOf!Range) input);
}

--

Reply via email to