If I had a simple class with two variables, x and y, and a function ToString() that returns a formatted string with the data. When I call
cout << simpleClass << "\n";
anyone know a way I could have simpleClass.ToString automatically called to return the correctly formatted string? I'm guessing there's a way to do this with operator functions, but I don't know how I would do this.
basic_ostream
objects, not justcout
– Stretchy