operator<< template error
Hello everybody out there I have a little problem while overloading the <<operator for a class Im doing (named Set) which uses templates. The line that specifically gives me an error is
template <typename Item>
ostream& operator<<(ostream& out, const Set<Item> &S)
the error it gives me is ::
bash-2.05b$ g++ setwithtemplates.cpp
setwithtemplates.cpp:25: warning: friend declaration `std: stream&
operator<<(std: stream&, const set<Item>&)' declares a non-template
function
setwithtemplates.cpp:25: warning: (if this is not what you intended, make sure
the function template has already been declared and add <> after the
function name here) -Wno-non-template-friend disables thi
z€K€ says:
s warning
/tmp/cc7w8oWB.o(.text+0x1d8): In function `main':
: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, set<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)'
collect2: ld returned 1 exit status
THANX