views:

54

answers:

2

I am trying to run a template function on a separate thread but IntelliSense (VC++ 2010 Express) keeps giving me the error: "Error: no instance of constructor "boost::thread::thread" matches the argument list" and if I try to compile I get this error: "error C2661: 'boost::thread::thread' : no overloaded function takes 5 arguments"

The error has only occurred since I added the templates so I'm certain it has something to do with them but I don't know what.

Two of the arguments I am passing to boost::thread are template functions defined as:

template<class F> 
void perform_test(int* current, int num_tests, F func, std::vector<std::pair<int, int>>* results);

and:

namespace Sort
{

template<class RandomAccessIterator>
void quick(RandomAccessIterator begin, RandomAccessIterator end);

} //namespace Sort

I try to call boost::thread like so:

std::vector<std::pair<int, int>> quick_results;
int current = 0, num_tests = 30;
boost::thread test_thread(perform_test, &current, num_tests, Sort::quick, &quick_results);