D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4888 - Heavy reliance on Bug 3534 in Phobos range usage
Summary: Heavy reliance on Bug 3534 in Phobos range usage
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Windows
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on: 3535
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-18 11:58 UTC by David Simcha
Modified: 2010-09-18 14:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2010-09-18 11:58:44 UTC
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.
Comment 1 David Simcha 2010-09-18 14:01:16 UTC
http://dsource.org/projects/phobos/changeset/2032