I have some experimental code I'm writing, and it seems when i return a structure it is either corrupted, or should be disallowed all together. A postblit is suggested this(this), but since I'm returning a structure that isn't tied to anything else it doesn't need to duplicate it.
Example: struct A{ int b; char c[]; } void fun1() { A a; a = fun2(); //array a.c corrupted, causes range exception //int a.b corrupted?!? } A fun2(){ A t; t.c.length = 100; /*do something*/ return t; //valid before returning. }