Given a raw memory area chunk, constructs an object of non-class type T at that address. The constructor is passed the arguments args, if any.
Preconditions: chunk must be at least as large as T needs and should have an alignment multiple of T's alignment.
Note: This function can be @trusted if the corresponding constructor of T is @safe.
A pointer to the newly constructed object.
struct S { int a, b; } auto buf = new void[S.sizeof]; S s; s.a = 42; s.b = 43; auto s1 = emplace!S(buf, s); assert(s1.a == 42 && s1.b == 43);
See Implementation
Given a raw memory area chunk, constructs an object of non-class type T at that address. The constructor is passed the arguments args, if any.
Preconditions: chunk must be at least as large as T needs and should have an alignment multiple of T's alignment.
Note: This function can be @trusted if the corresponding constructor of T is @safe.