Le 16/05/12 20:17, John M. Dlugosz a écrit :
On 5/16/2012 3:45 AM, Vicente J. Botet Escriba wrote:
have you tried with
boost::unique_future<T> f() { /// x return boost::detail::thread_move_t<T>(x); }
Writing it as two lines, boost::detail::thread_move_t<T> shuttle (x); return shuttle;
it's clear that the error is with the return statement. It insists that the copy constructor is callable, even though in reality it is optimized out. That is what the standard says. Perhaps other compilers ignore that fine print.
Yet, packaged_task::get_future seems to be able to return just fine.
Writing it as:
boost::detail::thread_move_t
shuttle (future_result); return unique_future<RetType>(shuttle); seems to work! Yea! Odd, I had tried the explicit construct around the operator all on one line yesterday, and it didn't help.
Could you try with trunk? Vicente