Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem with 'future' on compiler without move semantics
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-04-12 20:40:04


On Thu, Apr 12, 2012 at 5:37 PM, Jeffrey Lee Hellrung, Jr. <
jeffrey.hellrung_at_[hidden]> wrote:

> On Thu, Apr 12, 2012 at 4:26 PM, John M. Dlugosz <mpbecey7gu_at_[hidden]>wrote:
>
>> In my earlier note, I figured it should just work. But it's not.
>> I think it might be different on Boost 1.47?
>>
>>
>> Can anyone give me a VERY QUICK answer on how to return a unique_future
>> on a compiler without && using Boost 1.47?
>>
>
> compiler?
>

Sorry, I meant "which compiler?".

>
>
>> Thanks!
>> —John
>>
>>
>> In file included from /Volumes/VSee_Source/svnTree/**
>> Trunk/stable/Testing/**UnitTests/Tools/**threadpoolTest.cpp:2:
>>
>> ⋯: error: calling a private constructor of class
>> 'boost::unique_future<int>'
>>
>> return future_result; // built-in mover via implicit conversions
>>
>
> Try
>
> return boost::move(future_result);
>

Also, I'm pretty sure you'd need this regardless of the presence of (true)
rvalue references.

>
>> ^
>>
>> /⋯lTest.cpp:61:30: note: in instantiation of function template
>> specialization 'vst::async<int (*)()>' requested here
>>
>> vst::unique_future<int> fi= vst::async (&calculate_the_answer_to_*
>> *life_the_universe_and_**everything);
>>
>> ^
>>
>> /opt/local/include/boost/**thread/future.hpp:619:9: note: implicitly
>> declared private here
>>
>> unique_future(unique_future & rhs);// = delete;
>>
>> ^
>>
>
- Jeff



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