www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14394] New: byGrapheme does not preserve bidirectional ranges

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

          Issue ID: 14394
           Summary: byGrapheme does not preserve bidirectional ranges
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: public dicebot.lv

void main()
{
    import std.range, std.uni;
    auto range = "abcde".byGrapheme.retro();
}

Error: template std.range.retro cannot deduce function from argument types
!()(Result), candidates are:
/usr/include/dlang/dmd/std/range/package.d(182):       
std.range.retro(Range)(Range r) if (isBidirectionalRange!(Unqual!Range))

Looks like byGrapheme degrades bidirectional ranges into input ranges.

--
Apr 02 2015