CTFE Status 2

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 29 09:39:09 PDT 2017


On Friday, 28 April 2017 at 17:53:04 UTC, Stefan Koch wrote:
> 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]);

FIXED!


More information about the Digitalmars-d mailing list