VC6.0能运行.
#include <iostream.h>
#include <string.h
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;
}