title: How to deal with sstream vs. strstream inconsistency from old compilers
body: <p>I'm temporarily using gcc 2.95.2, and instead of having a <code>sstream</code> header, it defines a (slightly different, and deprecated) <code>strstream</code>. I'm currently getting around this with</p>
  
  <pre><code>#if __GNUC__ &lt; 3       // or whatever version number it changes
  #include &lt;strstream&gt;
  #else
  #include &lt;sstream&gt;
  #endif
  </code></pre>
  
  <p>and then things like:</p>
  
  <pre><code>#if __GNUC__ &lt; 3
      strstream str;
      str &lt;&lt; "Hello World";
  #else
      stringstream str("Hello World");
  #endif
  </code></pre>
  
  <p>but it's getting really annoying. I just want to make sure that when I switch back to a more recent gcc (or some other compiler), I don't have to rewrite these passages. Any thoughts?</p>