I'm trying to pass the function countVocals()
(which returns an integer) to a vector of future
but I'm getting this issue:
'No matching function for call to async:'
candidate template ignored
How can I fix it?
I have tried both with the following syntax and with a lambda expression but I get the same issue
int countVocals(std::string const &fileName, int &found);
std::vector<int> vocals(argc-1, 0);
std::vector<std::future<int>> futures(argc-1);
for (int i = 1; i < argc; i++) {
futures.push_back(std::async(countVocals, std::string(argv[i]), vocals.at(i-1)));