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.
ubyte[4] memory; auto i = emplace!int(memory); static assert(is(typeof(i) == int*)); assert(*i == 0); i = emplace!int(memory, 5); assert(*i == 5); static struct S { int i; @disable this(); @disable this(this); this(int i) @nogc nothrow pure @safe { this.i = i; } } auto s = emplace!S(memory, 8); static assert(is(typeof(s) == S*)); assert(s.i == 8);
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.