I have currently a working example:
#include <iostream>
#include <future>
int main() {
auto result = std::async([](int left, int right){return left + right;}, 1, 1);
std::cout<<"from async I get "<<result.get()<<"\n";
return 0;
}
This lambda does nothing but a simple addition, but I just fails to replace it with an operator:
auto result = std::async(operator+, 1, 1);
The error says use of undeclared 'operator+'
How do I fix it, to use an operator to replace the lambda?