www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4888] New: Heavy reliance on Bug 3534 in Phobos range usage

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

           Summary: Heavy reliance on Bug 3534 in Phobos range usage
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com
        Depends on: 3535


--- Comment #0 from David Simcha <dsimcha yahoo.com> 2010-09-18 11:58:44 PDT ---
Sort of a meta-bug.  Large portions of Phobos are relying on Bug 3534 to allow
const/immutable arrays to be used as ranges, because this bug allows calling
popFront() and popBack() on them.  Example from std.string:

sizediff_t
indexOf(Char1, Char2)(in Char1[] s, in Char2[] sub,
        CaseSensitive cs = CaseSensitive.yes)
{
    // Somewhere in the function body:
    immutable result = s.length - std.algorithm.find(s, sub).length;
}

This code doesn't work if std.array.popFront() is modified to not be callable
on const/immutable arrays.

This is just one example.  There are several more across much of Phobos.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 18 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4888


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from David Simcha <dsimcha yahoo.com> 2010-09-18 14:01:16 PDT ---
http://dsource.org/projects/phobos/changeset/2032

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