value to be copied into target
uninitialized value to be initialized with a copy of source
int source = 123; int target = void; copyEmplace(source, target); assert(target == 123);
immutable int[1][1] source = [ [123] ]; immutable int[1][1] target = void; copyEmplace(source, target); assert(target[0][0] == 123);
struct S { int x; void opAssign(const scope ref S rhs) @safe pure nothrow @nogc { assert(0); } } S source = S(42); S target = void; copyEmplace(source, target); assert(target.x == 42);
Emplaces a copy of the specified source value into uninitialized memory, i.e., simulates T target = source copy-construction for cases where the target memory is already allocated and to be initialized with a copy.