30#ifndef _BACKWARD_AUTO_PTR_H
31#define _BACKWARD_AUTO_PTR_H 1
36namespace std _GLIBCXX_VISIBILITY(default)
38_GLIBCXX_BEGIN_NAMESPACE_VERSION
47 template<
typename _Tp1>
54 } _GLIBCXX11_DEPRECATED;
56#pragma GCC diagnostic push
57#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
92 template<
typename _Tp>
130 template<
typename _Tp1>
144 reset(__a.release());
158 template<
typename _Tp1>
162 reset(__a.release());
189 __glibcxx_assert(_M_ptr != 0);
202 __glibcxx_assert(_M_ptr != 0);
217 get()
const throw() {
return _M_ptr; }
271 : _M_ptr(__ref._M_ptr) { }
276 if (__ref._M_ptr != this->get())
279 _M_ptr = __ref._M_ptr;
284 template<
typename _Tp1>
285 operator auto_ptr_ref<_Tp1>() throw()
286 {
return auto_ptr_ref<_Tp1>(this->
release()); }
288 template<
typename _Tp1>
289 operator auto_ptr<_Tp1>() throw()
290 {
return auto_ptr<_Tp1>(this->
release()); }
291 } _GLIBCXX11_DEPRECATED_SUGGEST(
"std::unique_ptr");
300 } _GLIBCXX11_DEPRECATED;
302#if __cplusplus >= 201103L
304 template<_Lock_policy _Lp>
305 template<
typename _Tp>
308 : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
311 template<
typename _Tp, _Lock_policy _Lp>
312 template<
typename _Tp1,
typename>
315 : _M_ptr(__r.get()), _M_refcount()
317 __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
318 static_assert(
sizeof(_Tp1) > 0,
"incomplete type" );
319 _Tp1* __tmp = __r.get();
320 _M_refcount = __shared_count<_Lp>(
std::move(__r));
321 _M_enable_shared_from_this_with(__tmp);
324 template<
typename _Tp>
325 template<
typename _Tp1,
typename>
328 : __shared_ptr<_Tp>(
std::
move(__r)) { }
331 template<
typename _Tp,
typename _Dp>
332 template<
typename _Up,
typename>
335 : _M_t(__u.release(), deleter_type()) { }
338#pragma GCC diagnostic pop
340_GLIBCXX_END_NAMESPACE_VERSION
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.
constexpr shared_ptr() noexcept
Construct an empty shared_ptr.
A simple smart pointer providing strict ownership semantics.
element_type * operator->() const
Smart pointer dereferencing.
auto_ptr & operator=(auto_ptr< _Tp1 > &__a)
auto_ptr assignment operator.
auto_ptr(auto_ptr< _Tp1 > &__a)
An auto_ptr can be constructed from another auto_ptr.
auto_ptr & operator=(auto_ptr &__a)
auto_ptr assignment operator.
auto_ptr(element_type *__p=0)
An auto_ptr is usually constructed from a raw pointer.
_Tp element_type
The pointed-to type.
void reset(element_type *__p=0)
Forcibly deletes the managed object.
auto_ptr(auto_ptr_ref< element_type > __ref)
Automatic conversions.
element_type * release()
Bypassing the smart pointer.
auto_ptr(auto_ptr &__a)
An auto_ptr can be constructed from another auto_ptr.
element_type * get() const
Bypassing the smart pointer.
element_type & operator*() const
Smart pointer dereferencing.
constexpr unique_ptr() noexcept
Default constructor, creates a unique_ptr that owns nothing.