I want to overload the << operator in my template class, and define it outside the template class.
using namespace std;
template <class T> class Child {
public:
friend ostream &operator << (ostream &Output, const Child &Object);
};
// What can I change to make my code work?
ostream &operator << (ostream &Output, const Child <T> &Object) {
}
As you can see, I don't know what the correct syntax is so that my code can run without errors. My C++ book does not go this in-depth. This has been really frustrating me so I would appreciate any help. Thank you :)