Export (0) Print
Expand All

ComPtr::operator= Operator

Assigns a value to the current ComPtr.

WRL_NOTHROW ComPtr& operator=(
   decltype(__nullptr)
);
WRL_NOTHROW ComPtr& operator=(
   _In_opt_ T *other
);
template <
   typename U
>
WRL_NOTHROW ComPtr& operator=(
   _In_opt_ U *other
);
WRL_NOTHROW ComPtr& operator=(
   const ComPtr &other
);
template<
   class U
>
WRL_NOTHROW ComPtr& operator=(
   const ComPtr<U>& other
);
WRL_NOTHROW ComPtr& operator=(
   _Inout_ ComPtr &&other
);
template<
   class U
>
WRL_NOTHROW ComPtr& operator=(
   _Inout_ ComPtr<U>&& other
);

U

A class.

other

A pointer, reference, or rvalue reference to a type or another ComPtr.

A reference to the current ComPtr.

The first version of this operator assigns an empty value to the current ComPtr.

In the second version, if the assigning interface pointer is not the same as the current ComPtr interface pointer, the second interface pointer is assigned to the current ComPtr.

In the third version, the assigning interface pointer is assigned to the current ComPtr.

In the fourth version, if the interface pointer of the assigning value is not the same as the current ComPtr interface pointer, the second interface pointer is assigned to the current ComPtr.

The fifth version is a copy operator; a reference to a ComPtr is assigned to the current ComPtr.

The sixth version is a copy operator that uses move semantics; an rvalue reference to a ComPtr if any type is static cast and then assigned to the current ComPtr.

The seventh version is a copy operator that uses move semantics; an rvalue reference to a ComPtr of type U is static cast then and assigned to the current ComPtr.

Header: client.h

Namespace: Microsoft::WRL

Show:
© 2014 Microsoft