Okay, but if I even try using that prototype here (with two params, the rhs stream and the lhs data), I get:
test.cpp:10: error: ‘test& test:perator<<(std:stream&, T&)’ must take exactly one argument
There are plenty of examples on the web using that model, but they all revolve around stuff like this:
Code:
cin >> obj;
cout << obj;
I suppose it is more like an input stream than an output one, so I'd be fine with:
Code:
"hello" >> 66 >> obj;
but the world does not work that way.
Just ignore the += for now, I see the problem but it is not a compilation error, so it's sort of irrelevant until the code compiles.
So I'm still of the opinion that you cannot do this:
Code:
obj << data << data << data;
Unless obj
is a steam object; you can't overload a stream operator and make it work, without an actual stream (I guess that shouldn't be surprising).