Value to be moved. If the argument is an lvalue and a struct with a destructor or postblit, it will be reset to its .init value.
A pointer to the new GC-allocated value.
struct S { int x; this(this) @disable; ~this() @safe pure nothrow @nogc {} } S* p; // rvalue p = moveToGC(S(123)); assert(p.x == 123); // lvalue auto lval = S(456); p = moveToGC(lval); assert(p.x == 456); assert(lval.x == 0);
Moves a value to a new GC allocation.