[Issue 6374] [CTFE] Cannot subscript using pointer to array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 24 14:53:02 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6374



--- Comment #1 from kennytm at gmail.com 2011-07-24 14:53:02 PDT ---
Note that this prevents std.array.appender from being CTFE-able, because it
contains the code:

                _data.arr.ptr[len] = cast(Unqual!T)item;  // <-- error
                _data.arr = _data.arr.ptr[0 .. len + 1];  // (OK)

Currently, this could be worked-around by swapping the two statements and use
the standard indexing:

                _data.arr = _data.arr.ptr[0 .. len+1];  // OK
                _data.arr[len] = cast(Unqual!T)item;    // now OK

but I think the more proper solution is to fix this bug.

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


More information about the Digitalmars-d-bugs mailing list