I have two templated overloaded friend functions in my Set class that keep sending back the error
Templatedriver.cpp:(.text+0x2a0): undefined reference to `std::ostream& operator<< <int>(std::ostream&, Set<int> const&)'
and
Templatedriver.cpp:(.text+0x2dd): undefined reference to `std::ostream& operator<< <int>(std::ostream&, Set<int> const&)'
and so on(simply changing the out for double, char, etc.) I have searched this up and the most common response on here is to do a forward declaration then declare it as a friend in the class, I have done this and still get an undefined reference
this is my forward declaration
template <class T> istream& operator>>(istream&, Set<T>&);
template <class T> ostream& operator<<(ostream&, const Set<T>&);
and I declare them in them in the class as such
template <class T>
class Set {
friend istream& operator>> <>(istream&, Set<T>&);
template <class Y> */friend ostream& operator<< <>(ostream&, const Set<T>&);
....//rest of class
}
and these are the definitions
template <class T> istream& operator>>(istream& is, Set<T>& S){
S.input();
return(is);
}
template <class T> ostream& operator<<(ostream& os, const Set<T>& S){
S.display();
return(os);
}
Theres a few more overloaded classes im having trouble with but it is all the same problem