WeakReference

Implements a Weak reference. The get() method returns null once the object pointed to has been collected.

Constructors

this
this(T obj)

Initializes a weak reference.

Destructor

~this
~this()

Clean up when we are no longer referenced.

Members

Aliases

opCall
alias opCall = get
Undocumented in source.

Functions

clear
void clear()

Clear the weak reference - get() will always return null.

get
T get()

Returns the weak reference - returns null if the object was deallocated in the meantime.

set
void set(T obj)

Host a different object reference.

Meta