How to get length of std::stringstream without copying
<p>How can I get the length in bytes of a stringstream.  </p>

<pre><code>stringstream.str().length();
</code></pre>

<p>would copy the contents into std::string.  I don't want to make a copy.</p>

<p>Or if anyone can suggest another iostream that works in memory, can be passed off for writing to another ostream, and can get the size of it easily I'll use that.</p>
