Rc

Helper struct that manages the reference count of an object using RAII.

Constructors

this
this(T obj)

Build a Rc instance with the provided resource

Destructor

~this
~this()

Removes a reference to the held reference.

Postblit

this(this)
this(this)

Postblit adds a reference to the held reference.

Alias This

obj

Members

Functions

giveAway
T giveAway()

Decrease the ref count and return the object without calling dispose

opAssign
void opAssign(T obj)

Assign another resource. Release the previously held ref and retain the new one.

opCast
bool opCast()

Check whether this Rc is assigned to a resource.

unload
void unload()

Reset the resource.

Properties

loaded
bool loaded [@property getter]

Check whether this Rc is assigned to a resource.

obj
inout(T) obj [@property getter]

Access to the held resource.

Meta