static struct S { int member = 5; this(this) @nogc nothrow pure @safe { assert(false); } } S source, target = void; moveEmplace(source, target); assert(target.member == 5); int x1 = 5, x2; moveEmplace(x1, x2); assert(x2 == 5);
$(D_PSYMBOL move), $(D_PSYMBOL hasElaborateCopyConstructor), $(D_PSYMBOL hasElaborateDestructor).
Precondition: &source !is &target.
Moves source into target assuming that target isn't initialized.
Moving the source copies it into the target and places the source into a valid but unspecified state, which means that after moving source can be destroyed or assigned a new value, but accessing it yields an unspecified value. No postblits or destructors are called. If the target should be destroyed before, use $(D_PSYMBOL move).
source and target must be different objects.