![]() |
#2
rjsp2020-05-14 12:49
|
class Complex
{
public:
friend ostream& operator<<(ostream& out,Complex& c);
}
//类外
ostream& operator<<(ostream& out,Complex<T>& c)
{
out<<c.a<<" "<<c.b<<endl;
return out;
}
这样写报错 模板类中友元函数重载<<运算符 应该怎么写?