Share via


WeakRef::WeakRef Constructor

Initializes a new instance of the WeakRef class.

WeakRef();
WeakRef(
   decltype(__nullptr)
);

WeakRef(
   _In_opt_ IWeakReference* ptr
);

WeakRef(
   const ComPtr<IWeakReference>& ptr
);

WeakRef(
   const WeakRef& ptr
);

WeakRef(
   _Inout_ WeakRef&& ptr
);

Parameters

  • ptr
    A pointer, reference, or rvalue-reference to an existing object that initializes the current WeakRef object.

Remarks

The first constructor initializes an empty WeakRef object. The second constructor initializes a WeakRef object from a pointer to the IWeakReference interface. The third constructor initializes a WeakRef object from a reference to a ComPtr< IWeakReference> object. The fourth and fifth constructors initializes a WeakRef object from another WeakRef object.

Requirements

Header: client.h

Namespace: Microsoft::WRL

See Also

Reference

WeakRef Class