Update of /cvsroot/boost/boost/boost
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30112/boost

Modified Files:
        shared_ptr.hpp 
Log Message:
Move support

Index: shared_ptr.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/shared_ptr.hpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- shared_ptr.hpp      9 Apr 2007 18:48:47 -0000       1.70
+++ shared_ptr.hpp      13 Apr 2007 22:04:22 -0000      1.71
@@ -306,6 +306,38 @@
 
 #endif // BOOST_NO_AUTO_PTR
 
+// Move support
+
+#if defined( BOOST_HAS_RVALUE_REFS )
+
+    shared_ptr( shared_ptr && r ): px( r.px ), pn() // never throws
+    {
+        pn.swap( r.pn );
+    }
+
+    template<class Y>
+    shared_ptr( shared_ptr<Y> && r ): px( r.px ), pn() // never throws
+    {
+        pn.swap( r.pn );
+    }
+
+    shared_ptr & operator=( shared_ptr && r ) // never throws
+    {
+        px = r.px;
+        pn.swap( r.pn );
+        return *this;
+    }
+
+    template<class Y>
+    shared_ptr & operator=( shared_ptr<Y> && r ) // never throws
+    {
+        px = r.px;
+        pn.swap( r.pn );
+        return *this;
+    }
+
+#endif
+
     void reset() // never throws in 1.30+
     {
         this_type().swap(*this);


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to