다음을 통해 공유


CAutoPtr::CAutoPtr

The constructor.

CAutoPtr( ) throw( ); 
explicit CAutoPtr( 
   T* p  
) throw( ); 
template< typename TSrc > CAutoPtr( 
   CAutoPtr< TSrc >& p  
) throw( ); 
template< > CAutoPtr( 
   CAutoPtr< T >& p  
) throw( );

Parameters

  • p
    An existing pointer.

  • TSrc
    The type being managed by another CAutoPtr, used to initialize the current object.

Remarks

The CAutoPtr object can be created using an existing pointer, in which case it transfers ownership of the pointer.

Example

See the example in the CAutoPtr Overview.

Requirements

Header: atlbase.h

See Also

Reference

CAutoPtr Class

CAutoPtr::~CAutoPtr