【发布时间】:2010-11-21 21:42:59
【问题描述】:
template <class T>
class ListRemake
{
...
friend ostream& operator << (ostream& out, const ListRemake& obj);
};
template <class T>
ostream& operator << (ostream& out, const ListRemake& obj)
{
for (int i = 0; i < obj.size; i++)
out << obj[i] << '\n';
return out;
}
给出错误 C2955: 'ListRemake' : 使用类模板需要模板参数列表。
【问题讨论】:
标签: c++ templates function-templates