title: Understanding the warning: binding r-value to l-value reference
body: <p>I want to pass a struct by reference so it won't be copied, but Resharper is giving the warning below:</p>
  
  <pre><code>struct sometype {
  };
  
  sometype foo() {
      sometype x;
      return x;
  }
  
  void bar() {
      sometype &amp; a = foo();//Binding r-value to l-value reference is non-standard Microsoft C++ extension
      sometype &amp;&amp; b = foo(); //ok
  }
  </code></pre>
  
  <p>Questions:</p>
  
  <p>What's wrong with <code>sometype &amp; a = foo();</code> ? isn't the return value from <code>foo()</code> an lvalue and <code>a</code> is also an lvalue?</p>
  
  <p>Is <code>sometype &amp;&amp; b = foo();</code> actually rvalue reference? Does it "steal" the return value from <code>foo()</code> and send what was in <code>b</code> to the destructor?</p>
  
  <p>Is there another way to not have this warning?</p>