i.e
Code:
template<typename T>
class Simple{
T A,B;
public:
/* Constructors and destructors */
T getA(){return A;}
T getB(){return B;}
ostream& operator(ostream& os){ return os<<A<<"-"<<B; }
// this doesn't work
}
template<typename T>
ostream& operator(ostream& os, Simple<T> P )
{ return os<<P.getA()<<"-"<<p.getB(); }
//this works
I can overload the +, - inside and outside the class.
But << and most probably >> has to be implemented as esternal function , why so ? any idea

