www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8764] New: chunks.transposed causes infinite ranges.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8764

           Summary: chunks.transposed causes infinite ranges.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: simen.kjaras gmail.com



PDT ---
import std.range;
import std.stdio : writeln;

void main( ) {
    ulong[1] t0;
    auto t1 = t0[].chunks(1).transposed;
    writeln(t1);
}

The above code spews out a never-ending string of [0]s.

Add a very simple .array before .transposed, and things work perfectly.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 05 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8764




https://github.com/D-Programming-Language/phobos/pull/1138

Note that calling .array will be made mandatory, because Chunks does not have
assignable subranges, so there's no way transpose can possibly work for it
(popping of subranges does not have lasting effect on the parent container).

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