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



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



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