Public Types | Public Member Functions | List of all members
ustl::auto_ptr< T > Class Template Reference

A smart pointer. More...

#include <ustl.h>

Public Types

typedef T value_type
 
typedef T * pointer
 
typedef T & reference
 

Public Member Functions

 auto_ptr (pointer p=nullptr)
 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. auto_ptr is deprecated in c++11; use unique_ptr instead.


The documentation for this class was generated from the following file:

Generated on Mon Sep 28 2015 17:58:50 for uSTL by Doxygen 1.8.10