Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60990 - in trunk: boost/thread libs/thread/test
From: anthony_at_[hidden]
Date: 2010-04-01 08:56:45


Author: anthonyw
Date: 2010-04-01 08:56:44 EDT (Thu, 01 Apr 2010)
New Revision: 60990
URL: http://svn.boost.org/trac/boost/changeset/60990

Log:
Fix use of rvalue ref in futures
Text files modified:
   trunk/boost/thread/future.hpp | 4 ++--
   trunk/libs/thread/test/test_futures.cpp | 4 ++--
   2 files changed, 4 insertions(+), 4 deletions(-)

Modified: trunk/boost/thread/future.hpp
==============================================================================
--- trunk/boost/thread/future.hpp (original)
+++ trunk/boost/thread/future.hpp 2010-04-01 08:56:44 EDT (Thu, 01 Apr 2010)
@@ -1,4 +1,4 @@
-// (C) Copyright 2008-9 Anthony Williams
+// (C) Copyright 2008-10 Anthony Williams
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -324,7 +324,7 @@
             move_dest_type get()
             {
                 wait();
- return *result;
+ return static_cast<move_dest_type>(*result);
             }
 
             future_state::state get_state()

Modified: trunk/libs/thread/test/test_futures.cpp
==============================================================================
--- trunk/libs/thread/test/test_futures.cpp (original)
+++ trunk/libs/thread/test/test_futures.cpp 2010-04-01 08:56:44 EDT (Thu, 01 Apr 2010)
@@ -1,4 +1,4 @@
-// (C) Copyright 2008-9 Anthony Williams
+// (C) Copyright 2008-10 Anthony Williams
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -89,7 +89,7 @@
 void test_store_value_from_thread()
 {
     boost::promise<int> pi2;
- boost::unique_future<int> fi2=pi2.get_future();
+ boost::unique_future<int> fi2(pi2.get_future());
     boost::thread(set_promise_thread,&pi2);
     int j=fi2.get();
     BOOST_CHECK(j==42);


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