模板类中的友元函数

friend ostream& operator<< <T>(ostream &out, Complex &c);


template <typename T>
ostream& operator<<(ostream &out, Complex<T> &c)
{
     out << c.a << " " << c.b << endl;
     return out;
}

posted @ 2018-09-04 17:31  unicoe  阅读(182)  评论(0编辑  收藏  举报