mardi 10 mars 2015

Threading a bool function passing string argument

I am new working with threads.. but I got the concept and have been playing with it in the last days. But now I am trying to create a thread calling a bool function and passing a string as argument. The code is basically:



bool className::analyseData(const std::string& filename) {
...
return true;
}

bool className::equalise(...) {
...
const std::string filename0 = filenameBase + "_chip" + ss.str() + "_0";
std::thread analyse_dat0(analyseData, &filename0);
...
return true;
}


and then I call equalise from other place.


But when I try to compile it I get the following error: SpidrEqualisation_multi_threading.cpp:140:50: error: no matching function for call to ‘std::thread::thread(<unresolved overloaded function type>, const string&)’ std::thread analyse_dat0(analyseData, filename0);


Any idea about how I can fix that?


Many thanks for the help.


Aucun commentaire:

Enregistrer un commentaire