Array copy warning

Benjamin Thaut code at benjamin-thaut.de
Sun Oct 13 06:15:42 PDT 2013


Am 13.10.2013 15:10, schrieb Benjamin Thaut:
> I'm just in the progress of upgrading to dmd 2.063 and I now get the
> following warnings in my code:
>
>   Warning: explicit element-wise assignment
> mem[cast(uint)0..this.length()] = (this.opSlice())[] is better than
> mem[cast(uint)0..this.length()] = this.opSlice()
>
> I don't quite understand this warning. It doesn't make much sense to
> overload the slice operator if I can't use it the same way as the
> regular slice operator on a "normal" array. Whats the idea behind this
> warning?

Additionally this warning appears in generic code. Which means I don't 
even now if a regular array is passed in as a argument or just a type 
which overloads the slice operator.

-- 
Kind Regards
Benjamin Thaut


More information about the Digitalmars-d-learn mailing list