Bug 8333 – std.Container.Array (and .Range) du not implement opIndexUnary

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-07-01T10:27:00Z
Last change time
2012-09-17T14:26:22Z
Assigned to
monarchdodra
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2012-07-01T10:27:44Z
This code does not compile: ---- import std.container; void main() { Array!int myList; myList.length = 2; auto range = myList[]; ++myList[0]; ++range[0]; } ---- Suggest adding: phobos / std / container.d l.1775 ---- void opIndexUnary(string op)(size_t i) { enforce(_a + i < _b && _b <= _outer._data._payload.length); mixin(op~"_outer._data._payload.ptr[_a + i];"); } ---- phobos / std / container.d l.1950 ---- /// ditto void opIndexUnary(string op)(size_t i) { mixin(op~"_data._payload[i];"); } ----
Comment #1 by monarchdodra — 2012-07-31T04:01:54Z
Comment #2 by monarchdodra — 2012-09-17T14:26:22Z