make

Allocate and construct an object of the specified type.

T*
make
(
T
Allocator
Args...
)
(
ref Allocator alloc
,
auto ref Args args
)
if (
isAllocator!Allocator
)

Examples

struct S { bool ok = false; bool notOk = true; }
Mallocator alloc;
S* p = alloc.make!S(true, false);
scope(exit) alloc.dispose(p);
assert(p.ok);
assert(!p.notOk);