The AutoPtr
class template allows a destruction policy to be provided, as an additional template parameter. Since not all objects have the same destruction requirements, the AutoPtr
template can be parameterized to support creating various types of AutoPtr
s differentiated by their destructor policy template parameter. Three templates provide specialized policies to the AutoPtr
.
AutoPtr
's default destructor policy is for use with a pointer pointing to a single object (one that is allocated by a call to the new operator and destroyed via a call to the delete operator).
ArrayAutoPtr
is intended for use with a pointer pointing to an array (one that is allocated via a call to operator new
[ and destroyed via operator delete
[).
DeleteThisAutoPtr
is intended for use with types requiring deallocation through a DeleteThis
method.
For more information please refer to maxsdk
\include\autoptr.h.