C++ Memory Library - auto_ptr



Description

It an automatic Pointer and it provides a limited garbage collection facility for pointers, by allowing pointers to have the elements they point to automatically destroyed when the auto_ptr object is itself destroyed.

Declaration

Following is the declaration for std::auto_ptr function.

template <class X> class auto_ptr;

C++11

template <class X> class auto_ptr;

Parameters

X − It is a managed object.

Member types

Member type Definition Notes
element_type class template parameter (X) The type of the managed object
memory.htm
Advertisements