title: std::stringstream and the str method
body: <p>I noticed something when trying to use the stringstream object. Here is a useless example to explain this:</p>
  
  <pre><code>stringstream ss ;
  ss &lt;&lt; "my string" ;
  cout &lt;&lt; ss.str() &lt;&lt; endl ;
  </code></pre>
  
  <p>Is not equivalent to</p>
  
  <pre><code>cout &lt;&lt; (stringstream() &lt;&lt; "my string").str() &lt;&lt; endl ;
  </code></pre>
  
  <p>This leads to a compilation error complaining that ‘class std::basic_ostream’ has no member named ‘str’.</p>
  
  <p>I can't easily explain this. This is not critical for my application but I'm pretty sure this is hiding a c++ trick interesting to be understood.</p>
  
  <p>Note: i'm using gcc with c++14 </p>