模板函数例子以及友元函数滥用的问题

使用模板函数实现一个复数类,熟悉模板函数的使用: (1)在类的内部实现 #include <iostream> using namespace std; template <typename T> class Complex { friend ostream & operator<< <T>(ostream &out, Complex c) { out << c.a << "+" <<
相关文章
相关标签/搜索