WeakReference

This class implements a weak reference wrapper for class T.

A weak reference will not prevent the object from being collected in a garbage collection cycle. If and when the object is collected, the internal reference to object will become null.

This weak reference wrapper is thread safe.

class WeakReference (
T
) if (
is(T == class) ||
is(T == interface)
) {}

Constructors

this
this(T object)

Create a weak reference wrapper for a given object.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

get
T get()

Return the referenced object held in this weak reference wrapper. If and when the object is collected, this function will return null.

opEquals
bool opEquals(Object other)

Parameters

T

The type of class.

See Also

Meta