I'm trying to make a class with a method that calls other method (that is in the same class) multiple times using multithreading. The code is something like this:
#include <iostream> #include <thread> using namespace std; class ThreadedMatcher { float Match() { thread t[5]; //5 is just as an aleatory number //The error doesn't change if I use a pointer (like thread *t;) for (int i = 0; i < num_jobs; i++) { t[i](partialMatch,i); } } void partialMatch(int i){ //Whathever I put in here doesn't change the error } } (this code is written in "ThreadedMatcher.h")
When I compile this, the next two errors appear:
error c3867: 'ThreadedMatcher::partialMatch': function call missing argument list; use '&ThreadedMatcher::partialMatch' to create a pointer to member
error c2064: term does not evaluate to a function taking 2 arguments
(these two errors refers to the part inside the for bucle)
If I follow the advise in the first error, the second error stays there anyway.
Could anyone tell me how to solve this? I'm using visual studio 2012 (c++11), in windows 8.
Thank you for any help you can provide.
PS: Sorry for my bad english, I did the best I could
static void partialMatch(int i);