c++ newbie here.
I've tried to initialize and set boost::unique_future variable value:
boost::unique_future<bool> result;
result = boost::async([this](){return false;});
But I've got next error on the second code string: Error: no operator "=" matches these operands, operand types are: boost::unique_future< bool> = boost::unique_future< void>.
And here user ikh successfully did this:
boost::unique_future<int> fu2 = boost::async([]{ return 43; });
But I've got the same error: Error: no operator "=" matches these operands, operand types are: boost::unique_future< int> = boost::unique_future< void>.
Where is my mistake?
result_of<decay<F>::type>::typeit getsvoid. Try usingboost::async<bool ()>([] { return false; });- Muepeboost::async<bool()>([] { return false; });this follows with: Error: no instance of overloaded function "boost::async" matches the argument list argument types are: (lamda []bool()->bool).result = boost::async<bool>([] { return false; });gave me "Error 10 error C2665: 'boost::async' : none of the 2 overloads could convert all the argument types" - J. Leeroy