注册 登录
编程论坛 C++教室

请问一个类模板的友元函数,在外部怎么定义?

w251311807 发布于 2008-10-30 08:49, 986 次点击
例子
#include <iostream.h>
using namespace std;
#include <iomanip.h>
#include <assert.h>
template<class T>
class at{
   friend ostream &operator<<(ostream &,const at<T> &)const;
}
//请问友元函数在外部怎么实现
3 回复
#2
中学者2008-10-30 10:09
你的声明都是错的...
#3
braveboy20082008-10-30 22:54
using namespace std;
不能放在两#include之间
#4
w2513118072008-11-15 14:41
可是能编译成功啊
我说的声明,那怎么写啊
1