How to initialize an immutable array

FG home at fgda.pl
Fri Mar 1 12:28:28 PST 2013


I suppose this:

immutable long DIM = 1024L*1024L *128L;
immutable(double)[] signal = new double[DIM+1];
static this() {
     for (long i=0L; i< DIM+1; i++) {
         signal[i] = (i+DIM)%7 + (i+DIM+1)%5;
     }
}
void main()
{ ... }



More information about the Digitalmars-d-learn mailing list