[Boost-bugs] [Boost C++ Libraries] #4521: Error using boost::move on packaged_task

Subject: [Boost-bugs] [Boost C++ Libraries] #4521: Error using boost::move on packaged_task
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-07 23:39:16


#4521: Error using boost::move on packaged_task
--------------------------+-------------------------------------------------
 Reporter: ZenJu | Owner:
     Type: Bugs | Status: new
Milestone: Boost 1.44.0 | Component: None
  Version: Boost 1.44.0 | Severity: Showstopper
 Keywords: |
--------------------------+-------------------------------------------------
 Hi,

 the example code on futures is broken on MSVC 10
 http://www.boost.org/doc/libs/1_43_0/doc/html/thread/synchronization.html#thread.synchronization.futures


 {{{
 int calculate_the_answer_to_life_the_universe_and_everything()
 {
     return 42;
 }
 boost::packaged_task<int>
 pt(calculate_the_answer_to_life_the_universe_and_everything);
 boost::unique_future<int> fi=pt.get_future();

 boost::thread task(boost::move(pt)); // launch task on a thread
 }}}

 However it works if BOOST_NO_RVALUE_REFERENCES is defined.
 Reproducible on v1.43 and 1.44 beta1

 Error:
 {{{
 1>shared\check_exist.cpp(16): error C2665: 'boost::move' : none of the 2
 overloads could convert all the argument types
 1> C:\Program
 Files\C++\Boost\boost/thread/detail/thread.hpp(359): could be
 'boost::thread &&boost::move(boost::thread &)'
 1> C:\Program
 Files\C++\Boost\boost/thread/detail/thread.hpp(363): or
 'boost::thread &&boost::move(boost::thread &&)'
 }}}


 Regards, ZenJu

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4521>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC