Class Weak<T>

    └ Object

Holds a weak reference to an object. A weak reference allows access to an object, but does not participate in reference counting. Objects are destroyed when there are no remaining normal ("strong") references to them, even if one or more Weak references remain in memory.

Source Code:
View Source

Initializer Summary

Creates a new Weak.
Inherited Fields:

Instance Method Summary

Returns the object referenced by this Weak.


init (value:T?)

Creates a new Weak.

value - value of type T?

Instance Methods

method get ():T

Returns the object referenced by this Weak. It is a safety violation to refer to an object after it has been destroyed (by having no remaining strong references to it); this will be detected using default compiler settings, but result in undefined behavior when safety checks are disabled.