I would like to overload the <<
operator, to print out a class instance to the console like this:
std::cout << instance << std::endl;
I've found a solution here: https://msdn.microsoft.com/en-us/library/1z2f6c2k.aspx
But I cannot use it, because my class is templated:
template<typename T>
myClass {
//code...
};
Edit:
I get an error, if I try to define it inside the class body: it must take only one argument