2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-23 18:12:12 +00:00

Thread: Added future/shared/future/promise/packaged_task::move() member function when no RVALUE is available (Useful for Sun compiler to force move semantics)

[SVN r77391]
This commit is contained in:
Vicente J. Botet Escriba
2012-03-18 22:06:44 +00:00
parent e8a4ed40a5
commit fceab582fe

View File

@@ -856,6 +856,14 @@ namespace boost
{
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 @@ namespace boost
{
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 @@ namespace boost
{
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 @@ namespace boost
{
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 @@ namespace boost
{
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 @@ namespace boost
{
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 @@ namespace boost
{
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 @@ namespace boost
{
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 @@ namespace boost
{
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