WeakReference<>

WeakReference<> class

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

class WeakReference<> : public WeakReference<System::Object>

Methods

MethodDescription
bool get_IsAlive() constGets an indication whether the object referenced by the current WeakReference object has been deleted.
const WeakPtr<Object>& get_Target() constGets the object (the target) referenced by the current WeakReference object.
void set_Target(const SmartPtr<Object>&)Sets the object (the target) referenced by the current WeakReference object.
WeakReference()Default constructor.
WeakReference(std::nullptr_t)Constructor from nullptr.
WeakReference(const SmartPtr<Object>&)Initializes a new instance of the WeakReference class, referencing the specified object.
WeakReference(const SmartPtr<Object>&, bool)Initializes a new instance of the WeakReference class, referencing the specified object.

See Also