prog.cpp:10:55: warning: friend declaration 'std::ostream& operator<<(std::ostream&, const test<T>&)' declares a non-template function [-Wnon-template-friend]
friend ostream & operator << (ostream &, const test &);
^
prog.cpp:10:55: note: (if this is not what you intended, make sure the function template has already been declared and add <> after the function name here)
prog.cpp:13:44: error: invalid use of template-name 'test' without an argument list
ostream & operator << (ostream &out, const test &t) {
^
prog.cpp: In function 'std::ostream& operator<<(std::ostream&, const int&)':
prog.cpp:14:16: error: request for member 'a' in 't', which is of non-class type 'const int'
return out<<t.a;
^