Hi,
I've just started reading about templates and have an error that I don't quite understand:
When I run, I get the error message: error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'S<T>'Code:template<class T> struct S { T val; S(T n):val(n) {} }; int main() { S<int> a = 2; cout << a; cin.get(); return 0; }
Why won't this print? It looks right to me?
Thanks