我刚刚尝试了以下代码
class MailBox{
};
template<typename T>
void foo(T){
cout << "In foo" << endl;
}
template<typename T>
void foo1(T){
foo(T);
}
main()
{
MailBox m;
std::vector<MailBox> m1;
foo1(m1);
}
编译时出现以下错误
test1.cpp: In function âvoid foo1(T)â:
test1.cpp:15: error: expected primary-expression before â)â token
知道如何解决这个问题吗?