Am 03.02.2013 10:23, schrieb timotheecour: That is a nice idea, but I would really like a in language solution so that:
int[10] a = [1,2,3,4,5,6,7,8,9]; //does not allocate, just initializes a
void foo1(scope int[]) { ... }
foo1([1,2,3,4,5,6,7,8,9]); //allocates the literal on the stack
void foo2(int[]){ ... }
foo2([1,2,3,4,5,6,7,8,9]); //allocates the literal on the heap
Kind Regards
Benjamin Thaut
