title: c++ : returning reference to temporary
body: <p>I have made this c++ code :</p>
  
  <pre><code>std::string const &amp;     Operand::toString() const
  {
    std::ostringstream    convert;
    convert &lt;&lt; this-&gt;value;
    return convert.str();
  }
  </code></pre>
  
  <p>The compiler tells me : <code>returning reference to temporary</code></p>
  
  <p>Am I forced to put <code>convert.str()</code> in my <code>Operand</code> class ?</p>
  
  <p>EDIT : It's for a school exercise, I can't change the prototype</p>