【发布时间】:2010-01-16 09:39:40
【问题描述】:
我的问题与this one 有点相关。
我想为某个类重载运算符
template <class T>
class A{
T t;
public:
A(T init) : t(init){}
friend ostream& operator<< <> (ostream &os, const A<T> &a); //need forward declaration
//template <class U> friend ostream& operator<< (ostream &os, const A<U> &a);
};
我是否用不同的符号来定义相同的事物?还是第一个版本在
【问题讨论】:
标签: c++ templates friend-function