Export (0) Print
Expand All

CAutoVectorPtr::Attach

Call this method to take ownership of an existing pointer.

void Attach( 
   T* p  
) throw( );

p

The CAutoVectorPtr object will take ownership of this pointer.

When a CAutoVectorPtr object takes ownership of a pointer, it will automatically delete the pointer and any allocated data when it goes out of scope. If CAutoVectorPtr::Detach is called, the programmer is again given responsibility for freeing any allocated resources.

In debug builds, an assertion failure will occur if the CAutoVectorPtr::m_p member variable currently points to an existing value; that is, it is not equal to NULL.

Header: atlbase.h

Show:
© 2015 Microsoft