[Issue 9507] New: std.range.transposed behaves poorly with jagged ranges of ranges

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 13 13:33:00 PST 2013


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

           Summary: std.range.transposed behaves poorly with jagged ranges
                    of ranges
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: hsteoh at quickfur.ath.cx


--- Comment #0 from hsteoh at quickfur.ath.cx 2013-02-13 13:32:56 PST ---
If you pass a jagged range of ranges to std.range.transposed, once one of the
subranges is consumed, .front will cause an invalid access to the empty
subrange's .front, causing a runtime error.

However, the returned range's .empty will still be false, even though you can't
safely use .front anymore!

So std.range.transposed should either return empty if *any* of its ranges are
empty, or else, its .front should be modified so that empty subranges will be
skipped over (or should there be an option to specify a default element?).

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


More information about the Digitalmars-d-bugs mailing list