auto_ptr Members

Reference

Constructors

auto_ptr

The constructor for objects of type auto_ptr.

Typedefs

element_type

The type is a synonym for the template parameter Type.

Member Functions

get

The member function returns the stored pointer myptr.

release

The member replaces the stored pointer myptr with a null pointer and returns the previously stored pointer.

reset

The member function evaluates the expression delete myptr, but only if the stored pointer value myptr changes as a result of function call. It then replaces the stored pointer with ptr.

Operators

operator=

An assignment operator that transfers ownership from one auto_ptr object to another.

operator*

The dereferencing operator for objects of type auto_ptr.

operator->

The operator for allowing member access.

operator auto_ptr<Other>

Casts from one kind of auto_ptr to another kind of auto_ptr.

operator auto_ptr_ref<Other>

Casts from an auto_ptr to an auto_ptr_ref.

See Also

Reference

auto_ptr Class

Thread Safety in the Standard C++ Library