http://d.puremagic.com/issues/show_bug.cgi?id=10543

           Summary: std.algorithm.map incorrectly uses source range length
                    for narrow strings
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Peter Alexander <[email protected]> 2013-07-04 
09:30:32 PDT ---
void main()
{
    import std.algorithm;
    import std.stdio;
    string s = "こんにちは世界";
    auto m = s.map!(a => 1);
    writeln(m, ", ", m.length);
}

Gives:

[1, 1, 1, 1, 1, 1, 1], 21

Clearly the reported length (21) is wrong, it should be 7.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to