newUnique

Create a new unique pointer of class type T, using allocator Allocator. T will be created by using constructor that accepts Args. The default allocator is Mallocator.

  1. auto newUnique(Args args)
    @safe @nogc @trusted
    newUnique
    (
    T
    Allocator = Mallocator
    Args...
    )
    (
    Args args
    )
    if (
    is(T == class)
    )
  2. auto newUnique(Args args)

Examples

class A {}
immutable auto unique = newUnique!A();

Meta