求助~~~~~~~~~~~~~哪里有错误,总是过不去
#include <iostream>#include <string>
using namespace std;
template<class T>
class ff
{
public:
ff(T a=T() ):value(a) {}
void setValue(T k) {value=k;}
friend ostream& operator << (ostream &,ff<T> &);
private:
T value;
};
template<class T>
ostream& operator << (ostream& output,ff<T>& cc)
{
output << "the value is " << cc.value() << endl;
return output;
}
int main()
{
ff<int> aa;
cout << aa ;
system("pause");
return 0;
}
我把它化的很简了,但是重载流和模板联系的时候还是有错,大家帮我看看,先谢了