摘要:
该函数为友元函数 不然是 time<<cout ostream & operator<<(ostream & os,const Time &t) { os<<XX<<' '<<YY; return os; } 在这里 return os是为了可以连贯的cout (cout<<1)<<Time; 重载 阅读全文
摘要:
每个成员函数都有一个this指向调用对象(this是个指针) 例 比较两个类大小 { if(a>b) return stock if(a<b) return *this } 阅读全文
摘要:
template <typename AnyType> void Swap(AnyType &a,AnyType &b)// AnyType *a是数组 { AnyType temp; temp=a; a=b; b=temp; } template<> void Swap<typename>(str 阅读全文