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 } _GLIBCXX11_DEPRECATED;
56 #pragma GCC diagnostic push 57 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 92 template<
typename _Tp>
109 auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
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; }
233 element_type* __tmp = _M_ptr;
246 reset(element_type* __p = 0) throw()
271 : _M_ptr(__ref._M_ptr) { }
276 if (__ref._M_ptr != this->get())
279 _M_ptr = __ref._M_ptr;
284 template<
typename _Tp1>
288 template<
typename _Tp1>
291 } _GLIBCXX11_DEPRECATED_SUGGEST(
"std::unique_ptr");
299 typedef void element_type;
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>
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
element_type * operator->() const
Smart pointer dereferencing.
element_type & operator*() const
Smart pointer dereferencing.
auto_ptr(auto_ptr &__a)
An auto_ptr can be constructed from another auto_ptr.
auto_ptr & operator=(auto_ptr &__a)
auto_ptr assignment operator.
void reset(element_type *__p=0)
Forcibly deletes the managed object.
auto_ptr(auto_ptr< _Tp1 > &__a)
An auto_ptr can be constructed from another auto_ptr.
auto_ptr(auto_ptr_ref< element_type > __ref)
Automatic conversions.
auto_ptr & operator=(auto_ptr< _Tp1 > &__a)
auto_ptr assignment operator.
ISO C++ entities toplevel namespace is std.
constexpr shared_ptr() noexcept
Construct an empty shared_ptr.
element_type * release()
Bypassing the smart pointer.
constexpr unique_ptr() noexcept
Default constructor, creates a unique_ptr that owns nothing.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
A simple smart pointer providing strict ownership semantics.
auto_ptr(element_type *__p=0)
An auto_ptr is usually constructed from a raw pointer.
_Tp element_type
The pointed-to type.