
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:: * are you compiling with -std=c++0x or -std=c++11? * 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. Please could you provide a complete example with the command line you are using? Best, Vicente