On 15/05/14 18:13, AntonSotov wrote:
DMD 2.065
I do not know much English. sorry.

need to initialize immutable array  "_items"
//-------------------------------------------------------
module main;
import std.stdio;

class Zond {
   this() {
     foreach (i; 1..4) {
       _items ~= i;  // is expected ERROR
     }
   }

   immutable(int[]) _items;

This might not bet what you were asking for, but alternativly you could use "iota":

import std.algorithm;
import std.range;

immutable(int[]) _items = 1.iota(4).array;

--
/Jacob Carlborg

Reply via email to