I’m trying to populate a vector threads; with a function that iterates through a directory, but im running into problems
this is what I have:
//create vector of threads
vector<thread> threads;
for(unsigned i=0; i < threadNum; ++i)
{
threads.push_back(thread(grep(arguments, r))); //best c++ 11
}
and this is the error that I am getting:
error c2440: '<function-style-cast>': cannot conver from 'void' to std::thread
can anyone explain why and perhaps hint an answer? thank you
edit
grep is the function name
void grep(Arguments arguments, regex r){}
Presumably you mean to say something like
or even better: