Unique.this

Takes ownership over value, setting the counter to 1. value may be a pointer, an object or a dynamic array.

  1. this(Payload!T value, Allocator allocator)
    struct Unique(T)
    this
    (
    Payload!T value
    ,)
  2. this(Allocator allocator)

Parameters

value Payload!T

Value whose ownership is taken over.

allocator Allocator

Allocator used to destroy the value and to allocate/deallocate internal storage.

Precondition: allocator !is null

Meta