title: Convert std::ostream to std::string
body: <p>Legacy code I maintain collects text into an <code>std::ostream</code>.  I'd like to convert this to a <code>std::string</code>.</p>
  
  <p>I've found examples of converting <code>std::sstringstream</code>, <code>std::ostringstream</code> etc to <code>std::string</code> but not explicitly <code>std::ostream</code> to <code>std::string</code>.</p>
  
  <p>How can I do that?  (Ancient C++ 98 only, no boost please)</p>