UFO: Alien Invasion
Loading...
Searching...
No Matches
AutoPtr< T > Class Template Reference

#include <autoptr.h>

Collaboration diagram for AutoPtr< T >:
Collaboration graph

Public Member Functions

 AutoPtr (T *const p=0)
 ~AutoPtr ()
void deallocate ()
T * release ()
void operator= (T *const p)
T * operator-> () const
T & operator* () const
 operator bool () const
 operator T* () const

Private Member Functions

 AutoPtr (const AutoPtr &)
void operator= (AutoPtr &)

Private Attributes

T * p_

Detailed Description

template<typename T>
class AutoPtr< T >

Definition at line 3 of file autoptr.h.

Constructor & Destructor Documentation

◆ AutoPtr() [1/2]

template<typename T>
AutoPtr< T >::AutoPtr ( T *const p = 0)
inlineexplicit

Definition at line 6 of file autoptr.h.

References p_.

Referenced by AutoPtr(), and operator=().

◆ ~AutoPtr()

template<typename T>
AutoPtr< T >::~AutoPtr ( )
inline

Definition at line 11 of file autoptr.h.

References p_.

◆ AutoPtr() [2/2]

template<typename T>
AutoPtr< T >::AutoPtr ( const AutoPtr< T > & )
private

References AutoPtr().

Member Function Documentation

◆ deallocate()

template<typename T>
void AutoPtr< T >::deallocate ( )
inline

Definition at line 17 of file autoptr.h.

◆ operator bool()

template<typename T>
AutoPtr< T >::operator bool ( ) const
inline

Definition at line 46 of file autoptr.h.

References p_.

◆ operator T*()

template<typename T>
AutoPtr< T >::operator T* ( ) const
inline

Definition at line 51 of file autoptr.h.

References p_.

◆ operator*()

template<typename T>
T & AutoPtr< T >::operator* ( ) const
inline

Definition at line 41 of file autoptr.h.

References p_.

◆ operator->()

template<typename T>
T * AutoPtr< T >::operator-> ( ) const
inline

Definition at line 36 of file autoptr.h.

References p_.

◆ operator=() [1/2]

template<typename T>
void AutoPtr< T >::operator= ( AutoPtr< T > & )
private

References AutoPtr().

◆ operator=() [2/2]

template<typename T>
void AutoPtr< T >::operator= ( T *const p)
inline

Definition at line 29 of file autoptr.h.

References p_.

◆ release()

template<typename T>
T * AutoPtr< T >::release ( )
inline

Definition at line 22 of file autoptr.h.

References p_.

Field Documentation

◆ p_

template<typename T>
T* AutoPtr< T >::p_
private

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