System::WeakReference< T > class

WeakReference< T > class

Represents a weak reference, which references an object while still allowing that object to be deleted.

template<typename T>class WeakReference< T > : public System::Object
ParameterDescription
TType of a referenced object.

Methods

MethodDescription
operator!=(std::nullptr_t) constChecks if referenced object is not null.
operator!=(const WeakReference<T>&) constCompares referenced object to another instance WeakReference class.
operator==(std::nullptr_t) constChecks if referenced object is null.
operator==(const WeakReference<T>&) constCompares referenced object to another instance WeakReference class.
reset()
SetTarget(const SmartPtr<T>&)Sets the object (the target) referenced by the current WeakReference object.
TryGetTarget(const SmartPtr<T>&) constGets the object (the target) referenced by the current WeakReference object.
WeakReference()Default constructor.
WeakReference(std::nullptr_t)Constructor from nullptr.
WeakReference(const SmartPtr<T>&)Initializes a new instance of the WeakReference class, referencing the specified object.
WeakReference(const SmartPtr<T>&, bool)Initializes a new instance of the WeakReference class, referencing the specified object.

See Also