Search code examples
d

How to generate array of int [] with iota?


I need to generate array of int []. How I can do it. Method iota return uint, but I need to get ints:

int [] myarr2 = (iota(0, 10).array);

app.d(11): Error: cannot implicitly convert expression (array(iota(0, 10))) of type uint[] to int[]


Solution

  • int[] myarr2 = iota!(int)(0, 10).array;