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

I just restored Array/Slice-Expansion.
I also introduced concat!

This will now compile with newCTFE!

static immutable uint[] OneToTen = [1,2,3,4,5,6,7,8,9,10];

const(uint[]) SliceOf1to10(uint lwr, uint upr)
{
    return OneToTen[lwr .. upr];
}

const(uint)[] testConcat()
{
    return SliceOf1to10(0,4) ~ SliceOf1to10(7,9);
}

static assert(testConcat == [1,2,3,4,8,9]);

Reply via email to