Boost logo

Boost Users :

Subject: Re: [Boost-users] [Thread] 1.53 fails to compile working code
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-02-10 11:21:22


Le 10/02/13 12:36, Szymon Gatner a écrit :
> 2013/2/10 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>:
>> I have made some updates to future.hpp and now the two tests work correctly.
>> I don't know if all the modifications are absolutely needed.
>>
>> Please, could you give it a try?
>>
> Original test code compiles OK now but unfortunately fails in other place:
>
> #include <boost/thread/future.hpp>
> #include <boost/container/vector.hpp>
>
> typedef boost::container::vector<int> V;
>
> int main()
> {
> boost::future<V> vf;
> V v(boost::move(vf.get())); // fails to compile
> // also fails: V v = boost::move(vf.get())
> }
>

vf.get() returns a rvalue and so boost::move doesn't work. You should use

     V v(vf.get());

Best,
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