#include <ustl.h>
Public Types | |
typedef T | value_type |
typedef T * | pointer |
typedef T & | reference |
Public Member Functions | |
auto_ptr (pointer p=NULL) | |
Takes ownership of p . | |
auto_ptr (auto_ptr< T > &p) | |
Takes ownership of pointer in p . p relinquishes ownership. | |
~auto_ptr (void) | |
Deletes the owned pointer. | |
pointer | get (void) const |
Returns the pointer without relinquishing ownership. | |
pointer | release (void) |
Returns the pointer and gives up ownership. | |
void | reset (pointer p) |
Deletes the pointer and sets it equal to p . | |
auto_ptr< T > & | operator= (pointer p) |
Takes ownership of p . | |
auto_ptr< T > & | operator= (auto_ptr< T > &p) |
Takes ownership of pointer in p . p relinquishes ownership. | |
reference | operator * (void) const |
pointer | operator-> (void) const |
bool | operator== (const pointer p) const |
bool | operator== (const auto_ptr< T > &p) const |
bool | operator< (const auto_ptr< T > &p) const |
Calls delete in the destructor; assignment transfers ownership. This class does not work with void pointers due to the absence of the required dereference operator.