Bug 4888 – Heavy reliance on Bug 3534 in Phobos range usage

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-09-18T11:58:00Z
Last change time
2010-09-18T14:01:16Z
Assigned to
nobody
Creator
dsimcha
Depends on
3535

Comments

Comment #0 by dsimcha — 2010-09-18T11:58:44Z
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 by dsimcha — 2010-09-18T14:01:16Z