I have a logging class with a std::stringstream member. I use it's output << overloading to get a nice easy means for catching all the data types std::stringstream gives me for free.
Here's the problem. After sending data into the stream, I want an easy way to flush it automatically to my destination (which is variable/dynamic in nature).
std::ostream
will "auto flush" if you send an endl
down it. That's and acceptable solution I would duplicate.
How can I implement that myself? Note that I don't want to override every operator<<()
overload in std::stringstream
!