Boost logo

Boost Users :

Subject: Re: [Boost-users] Difficulty using promises and futures
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2013-04-12 12:51:49


On Thu, Apr 11, 2013 at 5:03 PM, Vicente J. Botet Escriba <
vicente.botet_at_[hidden]> wrote:

> Le 11/04/13 00:15, Michael Powell a écrit :
>
> Hello,
>>
>> I would like to use promises and futures in our embedded app.
>>
>> We're targeting ArchLinux ARM. I believe we can build against a GCC 4.7.2
>> toolchain which has either C++0x or possibly even C++11 (somewhat) support.
>>
>> I am trying to setup a couple of simple issues to make it even compile,
>> but am having trouble.
>>
>> boost::packaged_task<vector<**int> > int_vect_pt_(simple_vector_*
>> *getter);
>> boost::unique_future<vector<**int> > int_vect_f_ =
>> int_vect_pt_.get_future();
>> boost::thread task(boost::move(int_vect_pt_)**);
>>
>> boost::packaged_task<int> int_pt_(simple_getter);
>> boost::unique_future<int> int_f_ = int_pt_.get_future();
>> boost::thread task(boost::move(int_pt_));
>>
>> Error(s):
>>
>> Description Resource Path Location Type
>> 'boost::move' is ambiguous '
>> Candidates are:
>> boost::type move(boost::packaged_task<int> &)
>> ' optics.cpp /detector/devices line 156 Semantic Error
>>
>> Description Resource Path Location Type
>> 'boost::move' is ambiguous '
>> Candidates are:
>> boost::type move(boost::packaged_task<std:**:vector<int,std::allocator<**int>>>
>> &)
>> ' optics.cpp /detector/devices line 152 Semantic Error
>>
>> Can anyone help or otherwise advise? I've even got a "crude" future
>> implementation in C# .NETCF for pity's sake... Anyway, if necessary, what
>> did we do before promises/futures? ;-)
>>
>>
>> Hi,
>
> some question:
> * which are the ambiguities the compiler finds? I see only one prototype
> for each line.
> * which vector are you using std::
>

Yes, std::vector.

> * are you compiling with -std=c++0x or -std=c++11?
>

Presently I am building with c++11 (preferred) using a GCC 4.7.2 based
toolchain I believe.

> * what version of Boost.Thread are you using? are you defining
> BOOST_THREAD_VERSION? I suggest you to define it to 4 either at the command
> line/build system or on your source file.
>

Not sure I understand where to define BOOST_THREAD_VERSION exactly? Is that
during the application build? Or during the boost build?

If app, could define that in the (CodeBench) compiler flags. Or in the
source file, I suppose, but that starts to get tricky with include
dependencies and such.

I gather in our app preprocessor defines, BOOST_THREAD_VERSION=4, but I
could be wrong.

I'll check that out.

> Please could you provide a complete example with the command line you are
> using?
>

That'll come next if these don't address the issue. Also I'm circling back
on it at the moment.

Thank ye.

> Best,
> Vicente
> ______________________________**_________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/**mailman/listinfo.cgi/boost-**users>
>



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