dimanche 26 octobre 2014

C++11, threads on templated functions


Vote count:

0




I am using C++11. I have a "templated" function:



class Bar
{
};

template<class T> foo()
{
// do something
}


and I would like to call it using threads. I'd tryed



std::thread t{foo}; // Not compiling: couldn't deduce template parameter ‘_Callable’ Ok I understand...
std::thread t{foo<Bar>}; // Not compiling neither.


Any ideas in how to make this work?


Thanks



asked 1 min ago







C++11, threads on templated functions

Aucun commentaire:

Enregistrer un commentaire