diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory index e846eba..36de296 100644 --- a/libstdc++-v3/include/std/memory +++ b/libstdc++-v3/include/std/memory @@ -80,11 +80,11 @@ # include # include # include +# include +# include # if _GLIBCXX_USE_DEPRECATED # include # endif -# include -# include #else # include #endif diff --git a/libstdc++-v3/include/backward/auto_ptr.h b/libstdc++-v3/include/backward/auto_ptr.h index 3c91c08..4a57518 100644 --- a/libstdc++-v3/include/backward/auto_ptr.h +++ b/libstdc++-v3/include/backward/auto_ptr.h @@ -289,6 +289,29 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef void element_type; } _GLIBCXX_DEPRECATED; +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + explicit + __shared_count::__shared_count(std::auto_ptr<_Tp>&& __r) + : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get())) + { __r.release(); } + + template + __shared_ptr::__shared_ptr(std::auto_ptr<_Tp1>&& __r) + : _M_ptr(__r.get()), _M_refcount() + { + __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) + static_assert( sizeof(_Tp1) > 0, "incomplete type" ); + _Tp1* __tmp = __r.get(); + _M_refcount = __shared_count<_Lp>(std::move(__r)); + __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp); + } + + template + unique_ptr(auto_ptr<_Up>&& __u) noexcept + : _M_t(__u.release(), deleter_type()) { } +#endif + _GLIBCXX_END_NAMESPACE_VERSION } // namespace diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index 39449f1..8a822be 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -54,6 +54,10 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION +#if _GLIBCXX_USE_DEPRECATED + template class auto_ptr; +#endif + /** * @brief Exception possibly thrown by @c shared_ptr. * @ingroup exceptions @@ -537,9 +541,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Special case for auto_ptr<_Tp> to provide the strong guarantee. template explicit - __shared_count(std::auto_ptr<_Tp>&& __r) - : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get())) - { __r.release(); } + __shared_count(std::auto_ptr<_Tp>&& __r); #endif // Special case for unique_ptr<_Tp,_Del> to provide the strong guarantee. diff --git a/libstdc++-v3/include/bits/unique_ptr.h b/libstdc++-v3/include/bits/unique_ptr.h index 0a12799..f7f6df9 100644 --- a/libstdc++-v3/include/bits/unique_ptr.h +++ b/libstdc++-v3/include/bits/unique_ptr.h @@ -45,6 +45,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @{ */ +#if _GLIBCXX_USE_DEPRECATED + template class auto_ptr; +#endif + /// Primary template, default_delete. template struct default_delete @@ -161,8 +165,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::enable_if::value && std::is_same<_Dp, default_delete<_Tp>>::value>::type> - unique_ptr(auto_ptr<_Up>&& __u) noexcept - : _M_t(__u.release(), deleter_type()) { } + unique_ptr(auto_ptr<_Up>&& __u) noexcept; #endif // Destructor.