AliasSeq of args with out, ref, and lazy saved.T * emplace(T)(T * chunk) @safe pure nothrowGiven a pointer `chunk` to uninitialized memory (but already typed as `T`), constructs an object of non-`class` type `T` at that address. If `T` is a class, initializes the class reference to null....T * emplace(T, Args...)(T * chunk, auto ref Args args) if (is(T == struct) || Args.length == 1)Given a pointer `chunk` to uninitialized memory (but already typed as a non-class type `T`), constructs an object of type `T` at that address from arguments `args`. If `T` is a class, initializes t...T emplace(T, Args...)(T chunk, auto ref Args args) if (is(T == class))Given a raw memory area `chunk` (but already typed as a class type `T`), constructs an object of `class` type `T` at that address. The constructor is passed the arguments `Args`. If `T` is an inner...T emplace(T, Args...)(void[] chunk, auto ref Args args) if (is(T == class))Given a raw memory area `chunk`, constructs an object of `class` type `T` at that address. The constructor is passed the arguments `Args`. If `T` is an inner class whose `outer` field can be used t...T * emplace(T, Args...)(void[] chunk, auto ref Args args) if (!is(T == class))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...void copyEmplace(S, T)(ref S source, ref T target) if (is(immutable S == immutable T)) @systemEmplaces 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 initi...void move(T)(ref T source, ref T target)Moves `source` into `target`, via a destructive copy when necessary.void moveEmplace(T)(ref T source, ref T target) @systemSimilar to move but assumes `target` is uninitialized. This is more efficient because `source` can be blitted over `target` without destroying or initializing it first.void wipe(T, Init...)(return scope ref T source, ref const scope Init initializer) if (!Init.length ||
((Init.length == 1) && (is(immutable T == immutable Init[0])))) @trustedT _d_newThrowable(T)() if (is(T : Throwable) && __traits(getLinkage, T) == "D") @trustedAllocate an exception of type `T` from the exception pool. `T` must be `Throwable` or derived from it and cannot be a COM or C++ class.T _d_newclassT(T)() if (is(T == class)) @trustedCreate a new class instance. Allocates memory and sets fields to their initial value, but does not call a constructor. --- new C() // dnewclass!(C)() --- Returns: newly created objectT _d_newclassTTrace(T)(string file = __FILE__, int line = __LINE__, string funcname = __FUNCTION__) @trustedTraceGC wrapper around dnewclassT.hasContextPointers = {
static if (__traits(isStaticArray, T))
{
return hasContextPointers!(typeof(T.init[0]));
}
else static if (is(T == struct))
{
import core.internal.traits : anySatisfy;
return __traits(isNested, T) || anySatisfy!(hasContextPointers, typeof(T.tupleof));
}
else return false;
} ()Forwards function arguments while keeping out, ref, and lazy on the parameters.
args | a parameter list or an AliasSeq. |
AliasSeq of args with out, ref, and lazy saved.Implementation of _d_delstruct and _d_delstructTrace
This is called for a delete statement where the value being deleted is a pointer to a struct with a destructor but doesn't have an overloaded delete operator.
p | pointer to the value to be deleted |
bypassed safety, purity, and throwabilty checks. To prevent breaking existing code, this function template is temporarily declared @trusted until the implementation can be brought up to modern D expectations.