我有一个基本上看起来像这样的类(我删除了不必要的代码):
class WilxList {
private:
struct Test{
double number;
int sign;
int rank;
};
bool testSorter(const Test & x1, const Test & x2);
public:
WilxList(std::vector<double> &argNumbers, std::string argName, int numberOfTests);
};
我正在尝试对这样的测试结构向量进行排序:
WilxList::WilxList(std::vector<double> &argNumbers, std::string argName, int numberOfTests)
{
//Omitted code
std::vector<Test> sortedTests;
//Omitted code where Tests are created and added to the vector inside for loop
std::sort(sortedTests.begin(), sortedTests.end(), testSorter); //ERROR
}
我得到的错误是:
error C3867: 'WilxList::testSorter': function call missing argument list;
use '&WilxList::testSorter' to create a pointer to member
c:\users\stenver\documents\visual studio 2012\projects\wilxoniastakutest\wilxoniastakutest\wilxlist.cpp