Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CHeapPtr Class
Collapse the table of content
Expand the table of content

CHeapPtr Class

A smart pointer class for managing heap pointers.

Important note Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

template< 
typename T, 
class Allocator= CCRTAllocator 
> class CHeapPtr : 
public CHeapPtrBase< T, Allocator>

T

The object type to be stored on the heap.

Allocator

The memory allocation class to use.

Name

Description

CHeapPtr::CHeapPtr

The constructor.

Name

Description

CHeapPtr::Allocate

Call this method to allocate memory on the heap to store objects.

CHeapPtr::Reallocate

Call this method to reallocate the memory on the heap.

Name

Description

CHeapPtr::operator =

The assignment operator.

CHeapPtr is derived from CHeapPtrBase and by default uses the CRT routines (in CCRTAllocator) to allocate and free memory. The class CHeapPtrList may be used to construct a list of heap pointers. See also CComHeapPtr, which uses COM memory allocation routines.

Header: atlcore.h

Show:
© 2015 Microsoft