为什么会有这样的功能
typedef std::vector<someclass> infocontainer;
double function2(const infocontainer&);
void function1(std::ostream&, const std::string&, double function2(const infocontainer&), const infocontainer, const infocontainer);
在 main 调用时运行良好
function1(std::cout, "astring", function2, did, didnt);
但是当 function2 有第二个参数时,它会产生错误。
double function2(const infocontainer&, std::string&);
void function1(std::ostream&, const std::string&, double function2(const infocontainer&, const std::string&), const infocontainer, const infocontainer);
主要的
function1(std::cout, "astring", function2, did, didnt);
candidate function not viable: no known conversion from 'double (const infocontainer &, const
std::string &)' to 'double (*)(const infocontainer &, std::string &)' for 3rd argument