Unique.create

Allows safe construction of Unique. It creates the resource and guarantees unique ownership of it (unless T publishes aliases of this). Note: Nested structs/classes cannot be created.

struct Unique(T)
version(None)
static
create
(
A...
)
(
auto ref A args
)
if (
__traits(compiles, new T(args))
)

Parameters

args A

Arguments to pass to T's constructor.

static class C {}
auto u = Unique!(C).create();

Meta