From 86d3f0aba7a094ab62a13da442cdd2ca13bd7623 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 15 Apr 2007 02:47:45 +0000 Subject: [PATCH] Changed move constructors/assignments to leave the source empty [SVN r37439] --- include/boost/shared_ptr.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/shared_ptr.hpp b/include/boost/shared_ptr.hpp index b8072ba..ec38248 100644 --- a/include/boost/shared_ptr.hpp +++ b/include/boost/shared_ptr.hpp @@ -313,26 +313,26 @@ public: shared_ptr( shared_ptr && r ): px( r.px ), pn() // never throws { pn.swap( r.pn ); + r.px = 0; } template shared_ptr( shared_ptr && r ): px( r.px ), pn() // never throws { pn.swap( r.pn ); + r.px = 0; } shared_ptr & operator=( shared_ptr && r ) // never throws { - px = r.px; - pn.swap( r.pn ); + this_type( static_cast< shared_ptr && >( r ) ).swap( *this ); return *this; } template shared_ptr & operator=( shared_ptr && r ) // never throws { - px = r.px; - pn.swap( r.pn ); + this_type( static_cast< shared_ptr && >( r ) ).swap( *this ); return *this; }