我得到的错误 - keyedcollection.h(34):错误C2955:“KeyedCollection”:使用类模板的要求类模板需要模板参数列表
我已搜查谷歌和其他网站几个小时,模板参数列表我仍然无法找到解决这个问题的办法。我有什么建议可以做什么?
声明:
friend ostream& operator<<(ostream&, const KeyedCollection&);
定义:
template <class K, class T>
ostream& operator<<(ostream& out, const KeyedCollection& e){
for (int i = 0; i < key.size(); i++){ out << key.at(i); }
return out;
}
提示:模板参数列表是您在<>中用来指定模板参数的东西。 – PlasmaHH
这就是我的想法,我在很多地方尝试过。但我不确定把它放在哪里。我在争论中想,但我不确定在哪里。 – user3236062
对于什么K和T被使用? – dieram3