ReactOS 0.4.15-dev-7953-g1f49173
auto_ptr< _Tp > Class Template Reference

#include <_auto_ptr.h>

Inheritance diagram for auto_ptr< _Tp >:
Collaboration diagram for auto_ptr< _Tp >:

Public Types

typedef _Tp element_type
 
typedef auto_ptr< _Tp > _Self
 

Public Member Functions

_Tp * release () _STLP_NOTHROW
 
void reset (_Tp *__px=0) _STLP_NOTHROW
 
_Tp * get () const _STLP_NOTHROW
 
_Tp * operator-> () const _STLP_NOTHROW
 
_Tp & operator* () const _STLP_NOTHROW
 
 auto_ptr (_Tp *__px=0) _STLP_NOTHROW
 
 auto_ptr (_Self &__r) _STLP_NOTHROW
 
_Selfoperator= (_Self &__r) _STLP_NOTHROW
 
 ~auto_ptr () _STLP_NOTHROW
 
 auto_ptr (auto_ptr_ref< _Tp > __r) _STLP_NOTHROW
 
_Selfoperator= (auto_ptr_ref< _Tp > __r) _STLP_NOTHROW
 
 operator auto_ptr_ref< _Tp > () _STLP_NOTHROW
 
- Public Member Functions inherited from __ptr_base
void __set (const volatile void *p)
 
void __set (void *p)
 

Additional Inherited Members

- Public Attributes inherited from __ptr_base
void_M_p
 

Detailed Description

template<class _Tp>
class auto_ptr< _Tp >

Definition at line 48 of file _auto_ptr.h.

Member Typedef Documentation

◆ _Self

template<class _Tp >
typedef auto_ptr<_Tp> auto_ptr< _Tp >::_Self

Definition at line 51 of file _auto_ptr.h.

◆ element_type

template<class _Tp >
typedef _Tp auto_ptr< _Tp >::element_type

Definition at line 50 of file _auto_ptr.h.

Constructor & Destructor Documentation

◆ auto_ptr() [1/3]

template<class _Tp >
auto_ptr< _Tp >::auto_ptr ( _Tp *  __px = 0)
inlineexplicit

Definition at line 84 of file _auto_ptr.h.

84{ this->__set(__px); }
void __set(const volatile void *p)
Definition: _auto_ptr.h:27

◆ auto_ptr() [2/3]

template<class _Tp >
auto_ptr< _Tp >::auto_ptr ( _Self __r)
inline

Definition at line 100 of file _auto_ptr.h.

100{ this->__set(__r.release()); }

◆ ~auto_ptr()

template<class _Tp >
auto_ptr< _Tp >::~auto_ptr ( )
inline

Definition at line 107 of file _auto_ptr.h.

107{ /* boris : reset(0) might be better */ delete this->get(); }
_Tp * get() const _STLP_NOTHROW
Definition: _auto_ptr.h:66

◆ auto_ptr() [3/3]

template<class _Tp >
auto_ptr< _Tp >::auto_ptr ( auto_ptr_ref< _Tp >  __r)
inline

Definition at line 109 of file _auto_ptr.h.

110 { this->__set(__r.release()); }
_Tp * release() const
Definition: _auto_ptr.h:39

Member Function Documentation

◆ get()

◆ operator auto_ptr_ref< _Tp >()

template<class _Tp >
auto_ptr< _Tp >::operator auto_ptr_ref< _Tp > ( )
inline

Definition at line 123 of file _auto_ptr.h.

124 { return auto_ptr_ref<_Tp>(*this, this->get()); }

◆ operator*()

template<class _Tp >
_Tp & auto_ptr< _Tp >::operator* ( ) const
inline

Definition at line 79 of file _auto_ptr.h.

79 {
80 _STLP_VERBOSE_ASSERT(get() != 0, _StlMsg_AUTO_PTR_NULL)
81 return *get();
82 }
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

◆ operator->()

template<class _Tp >
_Tp * auto_ptr< _Tp >::operator-> ( ) const
inline

Definition at line 74 of file _auto_ptr.h.

74 {
75 _STLP_VERBOSE_ASSERT(get() != 0, _StlMsg_AUTO_PTR_NULL)
76 return get();
77 }

◆ operator=() [1/2]

template<class _Tp >
_Self & auto_ptr< _Tp >::operator= ( _Self __r)
inline

Definition at line 102 of file _auto_ptr.h.

102 {
103 reset(__r.release());
104 return *this;
105 }
GLboolean reset
Definition: glext.h:5666

◆ operator=() [2/2]

template<class _Tp >
_Self & auto_ptr< _Tp >::operator= ( auto_ptr_ref< _Tp >  __r)
inline

Definition at line 112 of file _auto_ptr.h.

112 {
113 reset(__r.release());
114 return *this;
115 }

◆ release()

template<class _Tp >
_Tp * auto_ptr< _Tp >::release ( )
inline

Definition at line 53 of file _auto_ptr.h.

53 {
54 _Tp* __px = this->get();
55 this->_M_p = 0;
56 return __px;
57 }

Referenced by ios_base::_S_initialize(), CWineTest::GetNextTestInfo(), ios_base::sync_with_stdio(), SDIMainFrame::update_shell_browser(), and MDIShellBrowserChild::update_shell_browser().

◆ reset()

template<class _Tp >
void auto_ptr< _Tp >::reset ( _Tp *  __px = 0)
inline

Definition at line 59 of file _auto_ptr.h.

59 {
60 _Tp* __pt = this->get();
61 if (__px != __pt)
62 delete __pt;
63 this->__set(__px);
64 }

Referenced by ios_base::_S_initialize(), CWineTest::Run(), and ios_base::sync_with_stdio().


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