First, forgive if the title is not the most appropriate.
I am trying to write a google test, which launches several threads, as a testlogging. This would be the function that the threads would execute.
void log(std::vector<int>& A, severity_t severity){
for(size_t scanA(0);scanA!=A.size();++scanA){
switch(severity){
case severity_t::debug:
//do something
break;
case severity_t::info:
//do something
break;
default:
break;
}
}
}
The test is written as:
TEST(testLog, testA){
//Inicializo A
//Hago un thread para cada severity:
std::thread logDebug(std::bind(&log,A,severity_t::debug));
std::thread logInfo(std::bind(&log,A,severity_t::info));
//...
//Y hago el join para cada uno
logDebug.join();
logInfo.join();
//...
//Hago lo necesario para obtener resultados. y termino el test.
}
I am compiling in a redHat with gcc 4.4.7 and with -std = c ++ 0x by obligation. And the result of the compilation is: error: no matching function for call to 'bind (< unresolved overloaded function type & std :: vector