make

Constructs a value object of type T using args as the parameter list for the constructor of T and returns a pointer to the new object.

  1. T make(Allocator allocator, A args)
  2. T* make(Allocator allocator, A args)
    T*
    make
    (
    T
    A...
    )
    (,
    auto ref A args
    )
  3. T make(Allocator allocator, size_t n)

Parameters

T

Object type.

A

Types of the arguments to the constructor of T.

allocator Allocator

Allocator.

args A

Constructor arguments of T.

Return Value

Type: T*

Pointer to the created object.

Precondition: allocator !is null

Examples

int* i = defaultAllocator.make!int(5);
assert(*i == 5);
defaultAllocator.dispose(i);

Meta