问问题
2259 次
1 回答
5
You need to pass a function to the constructor of thread
. In your code, you are calling r.check()
and passing the result to the constructor of thread
, and a constructor which takes such an argument does not exist, hence the error.
The thread
constructor takes a function and arguments. And in the case of a member function, the first argument is the this
pointer. So for your code you need:
thread rt0 { &RowChecker::check, &r0 };
That will call RowChecker::check
on r0
.
于 2013-11-11T21:05:50.837 回答