System::WeakReference< T > 类

WeakReference< T > class

表示弱引用,它在引用对象的同时仍允许该对象被删除。

template<typename T>class WeakReference< T > : public System::Object
参数描述
T被引用对象的类型。

方法

方法描述
operator!=(std::nullptr_t) const检查被引用的对象是否非空。
operator!=(const WeakReference<T>&) const将被引用的对象与另一个实例 WeakReference 类进行比较。
operator==(std::nullptr_t) const检查被引用的对象是否为空。
operator==(const WeakReference<T>&) const将被引用的对象与另一个实例 WeakReference 类进行比较。
reset()
SetTarget(const SmartPtr<T>&)设置当前 WeakReference 对象所引用的对象(目标)。
TryGetTarget(const SmartPtr<T>&) const获取当前 WeakReference 对象所引用的对象(目标)。
WeakReference()默认构造函数。
WeakReference(std::nullptr_t)使用 nullptr 的构造函数。
WeakReference(const SmartPtr<T>&)初始化 WeakReference 类的新实例,引用指定的对象。
WeakReference(const SmartPtr<T>&, bool)初始化 WeakReference 类的新实例,引用指定的对象。

另见