在我的程序的主文件中,我有以下声明
int main()
{
Customer c;
Part p;
Builder b;
auto partsVec = readpartFile();
auto customerVec = readcustomerFile();
auto builderVec = readbuilderFile();
fexists("Parts.txt");
complexity(c, partsVec);
robotComplexity(partsVec,customerVec);
writeFile(buildAttempt(b, complexity(c, partsVec), variability(customerVec, builderVec)));
}
我的头文件包含以下内容
vector<Part> readpartFile();
vector<Customer> readcustomerFile();
vector<Builder> readbuilderFile();
float complexity(const Customer& c, const std::vector<Part>& parts);
void robotComplexity(vector<Part> vecB, vector<Customer> vecC);
double variability(const vector<Customer>& customerList, const vector<Builder>& builderList);
vector<double> buildAttempt(Builder b, double variaiblity, double complexityRobot);
void writeFile(vector<double> build);
除 robotsComplexity 外,所有功能都链接在一起。我在 main 中声明此函数会产生以下错误。
多个重载函数“robotComplexity”实例与参数列表匹配: -- function "robotComplexity(const std::vector> &parts, const std::vector> &customers)" -- function "robotComplexity(std::vector> vecB , std::vector> vecC)" -- 参数类型为: (std::vector>, std::vector>)
我不知道为什么我会收到这个错误或如何解决它