changeset: 4:ca88af4ad101 tag: tip user: Georg Sauthoff date: Thu Aug 06 19:13:18 2009 +0200 summary: pass rhs of assigment operator by value diff -r 7670ba12e523 -r ca88af4ad101 boost/smart_ptr/intrusive_ptr.hpp --- a/boost/smart_ptr/intrusive_ptr.hpp Thu Aug 06 19:05:37 2009 +0200 +++ b/boost/smart_ptr/intrusive_ptr.hpp Thu Aug 06 19:13:18 2009 +0200 @@ -101,16 +101,6 @@ if( px != 0 ) intrusive_ptr_release( px ); } -#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) - - template intrusive_ptr & operator=(intrusive_ptr const & rhs) - { - this_type(rhs).swap(*this); - return *this; - } - -#endif - // Move support #if defined( BOOST_HAS_RVALUE_REFS ) @@ -128,15 +118,9 @@ #endif - intrusive_ptr & operator=(intrusive_ptr const & rhs) + intrusive_ptr & operator=(intrusive_ptr temp_rhs) { - this_type(rhs).swap(*this); - return *this; - } - - intrusive_ptr & operator=(T * rhs) - { - this_type(rhs).swap(*this); + temp_rhs.swap(*this); return *this; }