Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76074 - trunk/libs/thread/test
From: vicente.botet_at_[hidden]
Date: 2011-12-19 18:22:08


Author: viboes
Date: 2011-12-19 18:22:08 EST (Mon, 19 Dec 2011)
New Revision: 76074
URL: http://svn.boost.org/trac/boost/changeset/76074

Log:
Thread: don't overload move when BOOST_NO_RVALUE_REFERENCES is not defined
Text files modified:
   trunk/libs/thread/test/test_move_function.cpp | 16 ++++++++++++++--
   1 files changed, 14 insertions(+), 2 deletions(-)

Modified: trunk/libs/thread/test/test_move_function.cpp
==============================================================================
--- trunk/libs/thread/test/test_move_function.cpp (original)
+++ trunk/libs/thread/test/test_move_function.cpp 2011-12-19 18:22:08 EST (Mon, 19 Dec 2011)
@@ -1,6 +1,6 @@
 // Copyright (C) 2007-8 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 #include <boost/thread/thread.hpp>
 #include <boost/test/unit_test.hpp>
@@ -89,10 +89,18 @@
     }
 
     bool move_called=false;
-
+
     struct nc:
         public boost::shared_ptr<int>
     {
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ nc() {}
+ nc(nc&&)
+ {
+ move_called=true;
+ return nc();
+ }
+#endif
         nc move()
         {
             move_called=true;
@@ -104,7 +112,11 @@
 void test_move_for_user_defined_type_unaffected()
 {
     user_test_ns::nc src;
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ user_test_ns::nc dest=boost::move(src);
+#else
     user_test_ns::nc dest=move(src);
+#endif
     BOOST_CHECK(user_test_ns::move_called);
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk