nogc_trynew

Attempts to allocate a new instance of T on the specified heap.

  1. Ref!T nogc_trynew(Args args)
  2. Ref!T nogc_trynew(NuHeap heap, Args args)
    @nogc @trusted nothrow
    Ref!T
    nogc_trynew
    (
    T
    Args...
    )
    (,
    auto ref Args args
    )

Parameters

heap NuHeap

The heap to allocate the instance on.

args Args

The arguments to pass to the type's constructor.

Return Value

Type: Ref!T

A reference to the instantiated object or null if allocation failed.

Meta