Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ustl::auto_ptr< T > Class Template Reference
[Memory Management]

A smart pointer. More...

#include <ustl.h>

List of all members.

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


Detailed Description

template<typename T>
class ustl::auto_ptr< T >

A smart pointer.

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.


The documentation for this class was generated from the following file:
Generated on Mon Jan 17 14:35:03 2005 for uSTL by 1.3.9 Doxygen Hosted on SourceForge.net