I just can't get QtConcurrent::run working with an overloaded static method:
class Foobar {
public:
static ResType foo(const cv::Mat& data, const QStringList& names, int clusters = 5);
static ResType foo(const cv::Mat& data, const cv::TermCriteria& tc, const QStringList& names, const QStringList& otherNames, int clusters, int covType = 2);
}
QtConcurrent::run(
static_cast<ResType (*)(const cv::Mat&, const cv::TermCriteria&,
const QStringList&, const QStringList&, int, int)>(&Foobar::foo),
sampleData, tc, mDimNames, mGmmNames, mClusterN, mCovType);
I get:
error: no matching function for call to ‘run(ResType (*)(const cv::Mat&, const cv::TermCriteria&, const QStringList&, const QStringList&, int, int), cv::Mat&, cv::TermCriteria&, QStringList&, QStringList&, int&, int&)’ sampleData, tc, mDimNames, mGmmNames, mClusterN, mCovType);
Note the ref (&) in the error message for the integer parameters. This baffles me....
Types of params:
cv::Mat sampleData, cv::TermCriteria tc, QStringList mDimNames, QStringList mGmmNames, int mClusterN, int mCovType
I thought the static_cast would help with distinguishing the overloads. The only difference I can see is, that the params are partly not const. But you can take a const ref of a Value type param, so why would that matter...