std compliant stringstream using stack allocated storage?
<p>Can't seem to find anything currently available in the wild, which seems odd.</p>

<p>So before I roll my own, does anyone know of a std compliant stringstream which allocates storage on the stack?</p>

<p>I'm thinking of 2 ways to achieve this:</p>

<p>Initially use a statically sized buffer on the stack (probably a template parameter to allow compile-time customization)</p>

<ol>
<li>When space runs out revert to using dynamic storage</li>
<li>When space runs out use <code>alloca</code> to increase the stack storage</li>
</ol>

<p>This will allow quick input into a stringstream for strings shorter than the predetermined size. </p>

<p>A suitable choice for the initial size will mean that things like logging can be achieved without frequent resizing from the heap.</p>
