Unique.release

Sets the internal pointer to $(D_KEYWORD). The allocator isn't changed.

struct Unique(T)
Payload!T
release
()

Return Value

Type: Payload!T

Reference to the owned object.

Examples

auto u = defaultAllocator.unique!int(5);
assert(u.isInitialized);

auto i = u.release();
assert(*i == 5);
assert(!u.isInitialized);

Meta