struct A {} struct B { A a; } struct C { A a; } A*[] structs; B b; init(&b); structs ~= cast(A*)&b; //Error: copying `cast(A*)& b` into allocated memory escapes a reference to local variable `b` C c; init(&c); structs ~= cast(A*)&c; //Error: copying `cast(A*)& c` into allocated memory escapes a reference to local variable `c` batch_process(structs);