I'm trying to use parallel_for, but I get an error, the code is:
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <ppl.h>
using namespace std;
using namespace concurrency;
int _tmain(int argc, _TCHAR* argv[])
{
parallel_for(size_t(0), 50, [&](size_t i)
{
cout << i << ",";
}
cout << endl;
getchar();
return 0;
}
The error is:
IntelliSense: no instance of overloaded function "parallel_for" matches the argument list >argument types are: (size_t, int, lambda []void (size_t i)->void
This is only example, I have to use it in bigger project, but first of all I want to understand how to use it properly.
*edit*
i changed the code to:
parallel_for(size_t(0), 50, [&](size_t i)
{
cout << i << ",";
});
but still i get the annoying error: IntelliSense: no instance of overloaded function "parallel_for" matches the argument list argument types are: (size_t, int, lambda []void (size_t i)->void)
parallel_for(size_t(0), size_t(50), [&](size_t i)...);- yohjpIntelliSensemessages are NOT compilation error! - Nawaz