D dynamic array initialization, stride and the index operation
问题 Sorry, this became a 3-fold question regarding arrays I think (dynamic) arrays are truly powerful in D, but the following has been bothering me for a while: In C++ I could easily allocate an array with designated values, but in D I haven't found a way to do so. Surely the following is no problem: int[] a = new int[N]; a[] = a0; But it looks inefficient, since line one will initialize with 0 , and like 2 with a0 . Could something similar to the following be done in D? int[] a = new int(a0)[N];