Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CAutoPtr::operator =

 

The assignment operator.


      template< >
CAutoPtr< T > & operator =(
   CAutoPtr< T > & p 
);
template< typename TSrc >
CAutoPtr< T > & operator =(
   CAutoPtr< TSrc > & p 
);

p

A pointer.

TSrc

A class type.

Returns a reference to a CAutoPtr< T >.

The assignment operator detaches the CAutoPtr object from any current pointer and attaches the new pointer, p, in its place.

Example

See the example in the CAutoPtr Overview.

Requirements

Header: atlbase.h

Show: