Hello!

Preface:
I need 1G array of ints (or anything else).

Problem:
I want to quickly fill it with my own data and I do not want to waste CPU time to fill it with zeros (or some other value).


I do like this:


void main() {
    int[] data;
    // key code:
data.length = SOMETHING; // how to create an array and leave it uninitialized?

    // fill 'data' with some data
    foreach(i, ref v; data) v=i; // an example
}

Is there a pure way to make what I want?

Reply via email to