Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77391 - trunk/boost/thread
From: vicente.botet_at_[hidden]
Date: 2012-03-18 18:06:45


Author: viboes
Date: 2012-03-18 18:06:44 EDT (Sun, 18 Mar 2012)
New Revision: 77391
URL: http://svn.boost.org/trac/boost/changeset/77391

Log:
Thread: Added future/shared/future/promise/packaged_task::move() member function when no RVALUE is available (Useful for Sun compiler to force move semantics)
Text files modified:
   trunk/boost/thread/future.hpp | 56 ++++++++++++++++++++++++++++++++++++++++
   1 files changed, 56 insertions(+), 0 deletions(-)

Modified: trunk/boost/thread/future.hpp
==============================================================================
--- trunk/boost/thread/future.hpp (original)
+++ trunk/boost/thread/future.hpp 2012-03-18 18:06:44 EDT (Sun, 18 Mar 2012)
@@ -856,6 +856,14 @@
         {
           return *static_cast<const ::boost::rv<BOOST_THREAD_FUTURE>* >(this);
         }
+ ::boost::rv<BOOST_THREAD_FUTURE>& move()
+ {
+ return *static_cast< ::boost::rv<BOOST_THREAD_FUTURE>* >(this);
+ }
+ const ::boost::rv<BOOST_THREAD_FUTURE>& move() const
+ {
+ return *static_cast<const ::boost::rv<BOOST_THREAD_FUTURE>* >(this);
+ }
 #else
         BOOST_THREAD_FUTURE(boost::detail::thread_move_t<BOOST_THREAD_FUTURE> other):
             future_(other->future_)
@@ -874,6 +882,10 @@
         {
             return boost::detail::thread_move_t<BOOST_THREAD_FUTURE>(*this);
         }
+ boost::detail::thread_move_t<BOOST_THREAD_FUTURE> move()
+ {
+ return boost::detail::thread_move_t<BOOST_THREAD_FUTURE>(*this);
+ }
 #endif
 #endif
 
@@ -1066,6 +1078,14 @@
         {
           return *static_cast<const ::boost::rv<shared_future>* >(this);
         }
+ ::boost::rv<shared_future>& move()
+ {
+ return *static_cast< ::boost::rv<shared_future>* >(this);
+ }
+ const ::boost::rv<shared_future>& move() const
+ {
+ return *static_cast<const ::boost::rv<shared_future>* >(this);
+ }
 
 #else
 
@@ -1097,6 +1117,10 @@
         {
             return boost::detail::thread_move_t<shared_future>(*this);
         }
+ boost::detail::thread_move_t<shared_future> move()
+ {
+ return boost::detail::thread_move_t<shared_future>(*this);
+ }
 #endif
 #endif
 
@@ -1302,6 +1326,14 @@
         {
           return *static_cast<const ::boost::rv<promise>* >(this);
         }
+ ::boost::rv<promise>& move()
+ {
+ return *static_cast< ::boost::rv<promise>* >(this);
+ }
+ const ::boost::rv<promise>& move() const
+ {
+ return *static_cast<const ::boost::rv<promise>* >(this);
+ }
 #else
         promise(boost::detail::thread_move_t<promise> rhs):
             future_(rhs->future_),future_obtained(rhs->future_obtained)
@@ -1477,6 +1509,14 @@
         {
           return *static_cast<const ::boost::rv<promise>* >(this);
         }
+ ::boost::rv<promise>& move()
+ {
+ return *static_cast< ::boost::rv<promise>* >(this);
+ }
+ const ::boost::rv<promise>& move() const
+ {
+ return *static_cast<const ::boost::rv<promise>* >(this);
+ }
 #else
         promise(boost::detail::thread_move_t<promise> rhs):
             future_(rhs->future_),future_obtained(rhs->future_obtained)
@@ -1497,6 +1537,10 @@
         {
             return boost::detail::thread_move_t<promise>(*this);
         }
+ boost::detail::thread_move_t<promise> move()
+ {
+ return boost::detail::thread_move_t<promise>(*this);
+ }
 #endif
 #endif
 
@@ -1781,6 +1825,14 @@
         {
           return *static_cast<const ::boost::rv<packaged_task>* >(this);
         }
+ ::boost::rv<packaged_task>& move()
+ {
+ return *static_cast< ::boost::rv<packaged_task>* >(this);
+ }
+ const ::boost::rv<packaged_task>& move() const
+ {
+ return *static_cast<const ::boost::rv<packaged_task>* >(this);
+ }
 #else
         packaged_task(boost::detail::thread_move_t<packaged_task> other):
             future_obtained(other->future_obtained)
@@ -1798,6 +1850,10 @@
         {
             return boost::detail::thread_move_t<packaged_task>(*this);
         }
+ boost::detail::thread_move_t<packaged_task> move()
+ {
+ return boost::detail::thread_move_t<packaged_task>(*this);
+ }
 #endif
 #endif
 


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