Static Constructors

Denis Koroskin 2korden at gmail.com
Sat Oct 4 15:59:50 PDT 2008


On Sun, 05 Oct 2008 01:37:30 +0400, Saaa <empty at needmail.com> wrote:

>
>> for example:
>>
>> int[] data = [0,1,2,3,4].dup;
> why the dup?
>

because [0,1,2,3,4] is readonly

>>
>> int[] dataslice = data[0..2];
>> dataslice.length = 1;
>>
>> assert(data[1] == 1); // this would fail
>>
>> -Steve
>
> Rest makes sense.
>
>


More information about the Digitalmars-d-learn mailing list