unique

Constructs a new object of type T and wraps it in a $(D_PSYMBOL Unique) using args as the parameter list for the constructor of T.

  1. Unique!T unique(Allocator allocator, A args)
    unique
    (
    T
    A...
    )
    (,
    auto ref A args
    )
    if (
    !is(T == interface) &&
    &&
    &&
    )
  2. Unique!T unique(Allocator allocator, size_t size)

Parameters

T

Type of the constructed object.

A

Types of the arguments to the constructor of T.

allocator Allocator

Allocator.

args A

Constructor arguments of T.

Return Value

Type: Unique!T

Newly created $(D_PSYMBOL Unique!T).

Precondition: allocator !is null

Meta