From 334654de06fb38a5d89a303966d106b9cfce54f2 Mon Sep 17 00:00:00 2001 From: Jonathan Wang Date: Sun, 15 Mar 2015 20:17:55 -0400 Subject: [PATCH] intrusive_ptr: add converting ctor for intrusive_ptr with move semantics. Analagous to template intrusive_ptr(intrusive_ptr const&) --- include/boost/smart_ptr/intrusive_ptr.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/boost/smart_ptr/intrusive_ptr.hpp b/include/boost/smart_ptr/intrusive_ptr.hpp index e5db609..0b02eba 100644 --- a/include/boost/smart_ptr/intrusive_ptr.hpp +++ b/include/boost/smart_ptr/intrusive_ptr.hpp @@ -122,6 +122,20 @@ public: return *this; } +#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) + template friend class intrusive_ptr; + template +#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) + intrusive_ptr(intrusive_ptr && rhs, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty()) +#else + intrusive_ptr(intrusive_ptr && rhs) +#endif + : px( rhs.px ) + { + rhs.px = 0; + } +#endif + #endif intrusive_ptr & operator=(intrusive_ptr const & rhs)