J
Jag
Can some kind soul help me to fix this issue. Thanks.
Jag
---------------
template <typename T>
class sgraph {
public:
friend ostream& operator<< <>(ostream& o, const sgraph<T>& s) ;
}
template <typename T>
ostream& operator<<(ostream& o, const sgraph<T>& s) {
return o ;
}
gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)
sgraph.h: In instantiation of `sgraph<int>':
sgraph.cpp:26: instantiated from here
sgraph.h:123: error: template-id `operator<< <>' for
`std::basic_ostream<char, std::char_traits<char> >&
operator<<(std::basic_ostream<char, std::char_traits<char> >&, const
sgraph<int>&)' does not match any template declaration
Jag
---------------
template <typename T>
class sgraph {
public:
friend ostream& operator<< <>(ostream& o, const sgraph<T>& s) ;
}
template <typename T>
ostream& operator<<(ostream& o, const sgraph<T>& s) {
return o ;
}
gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)
sgraph.h: In instantiation of `sgraph<int>':
sgraph.cpp:26: instantiated from here
sgraph.h:123: error: template-id `operator<< <>' for
`std::basic_ostream<char, std::char_traits<char> >&
operator<<(std::basic_ostream<char, std::char_traits<char> >&, const
sgraph<int>&)' does not match any template declaration