Well, I\'m new to operator overloading, and I found this problem. Instead of documenting myself, I prefer to ask you :D
The point is, I know how to do simple operator ov
The trick is to return a reference to youself from operator <<
- this way, the operator can be 'stacked'.
class me {
me& operator<<(int t) {...; return *this;}
};
me m;
m << 4 << 5 << 6;
Just overload the shift operator for all types you wish to support (or make it a template if you can afford the danger)!