c++ stream manipulator that inserts a multi-character delimiter if stream is not empty
The context here is building a string with comma-delimited stats, some of which may not be available (like PID, GID, etc). I'm trying to avoid having a comma as the first character in the stream. And boost::join(list, ", ")
is more cumbersome, I'd prefer to output directly to the stream instead of a temporary list which I then join at the end.