title: warning: returning reference to temporary
body: <p>I have a function like this</p>
  
  <pre><code>const string &amp;SomeClass::Foo(int Value)
  {
      if (Value &lt; 0 or Value &gt; 10)
          return "";
      else
          return SomeClass::StaticMember[i];
  }
  </code></pre>
  
  <p>I get <code>warning: returning reference to temporary</code>. Why is that? I thought the both values the function returns (reference to const char* "" and reference to a static member) cannot be temporary.</p>