Boost logo

Boost Users :

Subject: Re: [Boost-users] unique_future without rvalue references
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-05-16 14:27:47


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<unique_future<RetType> > 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net