33#ifndef _RWSTD_RW_AUTOPTR_H_INCLUDED
34#define _RWSTD_RW_AUTOPTR_H_INCLUDED
36#ifndef _RWSTD_RW_DEFS_H_INCLUDED
44template <
class _TypeT>
45struct __rw_nonvoid_ref
47 typedef _TypeT& _C_ref;
52struct __rw_nonvoid_ref<void>
60#ifndef _RWSTD_NO_CV_VOID_SPECIALIZATIONS
63struct __rw_nonvoid_ref<const void>
69struct __rw_nonvoid_ref<volatile void>
75struct __rw_nonvoid_ref<const volatile void>
90template <
class _TypeT>
96template <
class _TypeT>
99 template <
class _TypeU>
100 friend class auto_ptr;
104 template <
class _TypeU>
105 auto_ptr_ref (auto_ptr<_TypeU>& __rhs,
const _TypeU* = 0)
_THROWS (())
109 auto_ptr<_TypeT>& _C_ptr;
113template<
class _TypeT>
117 typedef _TypeT element_type;
120 explicit auto_ptr (element_type* __p = 0)
_THROWS (())
124 auto_ptr (auto_ptr& __rhs)
_THROWS (())
125 : _C_ptr (__rhs.release ()) { }
128 auto_ptr& operator= (auto_ptr& __rhs)
_THROWS (()) {
129 reset (__rhs.release ());
139 template <
class _TypeU>
140 auto_ptr (auto_ptr<_TypeU>& __rhs)
_THROWS (())
141 : _C_ptr (__rhs.release ()) { }
144 template <
class _TypeU>
145 auto_ptr& operator= (auto_ptr<_TypeU>& __rhs)
_THROWS (()) {
146 reset (__rhs.release ());
151 template <
class _TypeU>
152 operator auto_ptr_ref<_TypeU>()
_THROWS (()) {
154 return auto_ptr_ref<_TypeU>(*
this, _C_ptr);
158 template <
class _TypeU>
159 operator auto_ptr<_TypeU>()
_THROWS (()) {
160 return auto_ptr<_TypeU>(release ());
164 typename _RW::__rw_nonvoid_ref<element_type>::_C_ref
170#ifndef _RWSTD_NO_NONCLASS_ARROW_RETURN
173 element_type* operator->()
const _THROWS (()) {
183 element_type* get ()
const _THROWS (()) {
188 element_type* release ()
_THROWS (()) {
189 element_type* __tmp = _C_ptr;
195 void reset (element_type* __p = 0)
_THROWS (()) {
203 auto_ptr (auto_ptr_ref<element_type> __r)
_THROWS (())
204 : _C_ptr (__r._C_ptr.release ()) { }
207 auto_ptr& operator= (auto_ptr_ref<element_type> __rhs)
_THROWS (()) {
208 reset (__rhs._C_ptr.release ());
213 element_type* _C_ptr;
const plus_asgn< T > & operator*(const plus_asgn< T > &lhs, const plus_asgn< T > &rhs)
#define _RWSTD_SPECIALIZED_CLASS
#define _RWSTD_REINTERPRET_CAST(T, x)
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_ASSERT(ignore)