Constructed type.
Types of the constructor arguments if T has a constructor or the type of the initial value.
Constructor arguments if T has a constructor or the initial value.
New instance of type T constructed in memory.
Precondition: memory.length == stateSize!T. Postcondition: memory and the result point to the same memory.
class C { int i = 5; class Inner { int i; this(int param) pure nothrow @safe @nogc { this.i = param; } } } ubyte[stateSize!C] memory1; ubyte[stateSize!(C.Inner)] memory2; auto c = emplace!C(memory1); assert(c.i == 5); auto inner = emplace!(C.Inner)(memory2, c, 8); assert(c.i == 5); assert(inner.i == 8); assert(inner.outer is c);
Constructs a new object of type T in memory with the given arguments.
If T is a $(D_KEYWORD class), emplace returns a class reference of type T, otherwise a pointer to the constructed object is returned.
If T is a nested class inside another class, outer should be an instance of the outer class.
args are arguments for the constructor of T. If T isn't an aggregate type and doesn't have a constructor, memory can be initialized to args[0] if Args.length == 1, Args[0] should be implicitly convertible to T then.