On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote:
[ ... ]

Hi Guys, I just implemented sliceAssigment.

meaning the following code will now compile:

uint[] assignSlice(uint from, uint to, uint[] stuff)
{
    uint[] slice;
    slice.length = to + 4;
    foreach (uint i; 0 .. to + 4)
    {
        slice[i] = i + 1;
    }

    slice[from .. to] = stuff;
    return slice;
}

static assert(assignSlice(1, 4, [9, 8, 7]) == [1, 9, 8, 7, 5, 6, 7, 8]);

Reply via email to