将特定的模板设为友元
<br />类模板中有三种友元:普通友元;一般模板友元关系;特定的模板友元关系;<br />第2种:<br />#include <iostream>
using namespace std;
template<class T>
class A;
template<class T>
ostream & operator <<(ostream &, const A<T>&);
template<class T>
void memfcn(const A<T> &);
template<
原创
2010-08-12 18:23:00 ·
452 阅读 ·
0 评论