30 #ifndef _BACKWARD_AUTO_PTR_H 31 #define _BACKWARD_AUTO_PTR_H 1 36 namespace std _GLIBCXX_VISIBILITY(default)
38 _GLIBCXX_BEGIN_NAMESPACE_VERSION
47 template<
typename _Tp1>
54 } _GLIBCXX_DEPRECATED;
56 #pragma GCC diagnostic push 57 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 88 template<
typename _Tp>
126 template<
typename _Tp1>
140 reset(__a.release());
154 template<
typename _Tp1>
158 reset(__a.release());
185 __glibcxx_assert(_M_ptr != 0);
198 __glibcxx_assert(_M_ptr != 0);
213 get()
const throw() {
return _M_ptr; }
267 : _M_ptr(__ref._M_ptr) { }
272 if (__ref._M_ptr != this->get())
275 _M_ptr = __ref._M_ptr;
280 template<
typename _Tp1>
281 operator auto_ptr_ref<_Tp1>() throw()
282 {
return auto_ptr_ref<_Tp1>(this->
release()); }
284 template<
typename _Tp1>
285 operator auto_ptr<_Tp1>() throw()
286 {
return auto_ptr<_Tp1>(this->
release()); }
287 } _GLIBCXX_DEPRECATED;
296 } _GLIBCXX_DEPRECATED;
298 #if __cplusplus >= 201103L 299 template<_Lock_policy _Lp>
300 template<
typename _Tp>
303 : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
306 template<
typename _Tp, _Lock_policy _Lp>
307 template<
typename _Tp1,
typename>
310 : _M_ptr(__r.get()), _M_refcount()
312 __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
313 static_assert(
sizeof(_Tp1) > 0,
"incomplete type" );
314 _Tp1* __tmp = __r.get();
315 _M_refcount = __shared_count<_Lp>(std::move(__r));
316 _M_enable_shared_from_this_with(__tmp);
319 template<
typename _Tp>
320 template<
typename _Tp1,
typename>
323 : __shared_ptr<_Tp>(
std::move(__r)) { }
325 template<
typename _Tp,
typename _Dp>
326 template<
typename _Up,
typename>
329 : _M_t(__u.release(), deleter_type()) { }
332 #pragma GCC diagnostic pop 334 _GLIBCXX_END_NAMESPACE_VERSION
element_type * get() const
Bypassing the smart pointer.
auto_ptr(element_type *__p=0)
An auto_ptr is usually constructed from a raw pointer.
constexpr shared_ptr() noexcept
Construct an empty shared_ptr.
A simple smart pointer providing strict ownership semantics.
auto_ptr(auto_ptr_ref< element_type > __ref)
Automatic conversions.
element_type * release()
Bypassing the smart pointer.
ISO C++ entities toplevel namespace is std.
void reset(element_type *__p=0)
Forcibly deletes the managed object.
element_type * operator->() const
Smart pointer dereferencing.
auto_ptr & operator=(auto_ptr &__a)
auto_ptr assignment operator.
auto_ptr & operator=(auto_ptr< _Tp1 > &__a)
auto_ptr assignment operator.
_Tp element_type
The pointed-to type.
auto_ptr(auto_ptr &__a)
An auto_ptr can be constructed from another auto_ptr.
element_type & operator*() const
Smart pointer dereferencing.
auto_ptr(auto_ptr< _Tp1 > &__a)
An auto_ptr can be constructed from another auto_ptr.
constexpr unique_ptr() noexcept
Default constructor, creates a unique_ptr that owns nothing.