Ticket #2312: intrusive_ptr.ass.value.patch

File intrusive_ptr.ass.value.patch, 1.2 KB (added by Georg Sauthoff <gsauthof@…>, 13 years ago)
  • boost/smart_ptr/intrusive_ptr.hpp

    changeset:   4:ca88af4ad101
    tag:         tip
    user:        Georg Sauthoff <gsauthof@techfak.uni-bielefeld.de>
    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 b  
    101101        if( px != 0 ) intrusive_ptr_release( px );
    102102    }
    103103
    104 #if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES)
    105 
    106     template<class U> intrusive_ptr & operator=(intrusive_ptr<U> const & rhs)
    107     {
    108         this_type(rhs).swap(*this);
    109         return *this;
    110     }
    111 
    112 #endif
    113 
    114104// Move support
    115105
    116106#if defined( BOOST_HAS_RVALUE_REFS )
     
    128118
    129119#endif
    130120
    131     intrusive_ptr & operator=(intrusive_ptr const & rhs)
     121    intrusive_ptr & operator=(intrusive_ptr temp_rhs)
    132122    {
    133         this_type(rhs).swap(*this);
    134         return *this;
    135     }
    136 
    137     intrusive_ptr & operator=(T * rhs)
    138     {
    139         this_type(rhs).swap(*this);
     123        temp_rhs.swap(*this);
    140124        return *this;
    141125    }
    142126