[Issue 6531] assertion failure in std.range.iota

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 11 07:13:12 PDT 2013


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


drug007 <drug2004 at bk.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |drug2004 at bk.ru


--- Comment #6 from drug007 <drug2004 at bk.ru> 2013-04-11 07:13:10 PDT ---
I propose the following:

    auto pastEnd = start + count * step;
    if (step > 0)
    {
        if (pastEnd < end) {
            ++count;
            pastEnd = start + count * step;
        }
        assert(pastEnd >= end);
    }
    else
    {
        if (pastEnd > end) {
            ++count;
            pastEnd = start + count * step;
        }
        assert(pastEnd <= end);
    }

Martin Nowak's fix is the better (simpler and more clear) but I just don't like
cast.

-- 
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