title: binding a lvalue to a rvalue reference under MSVS2010
body: <pre><code>#include&lt;iostream&gt;
  
  template&lt;class T&gt;
  struct Foo
  {
      T v_;
  
      Foo(T&amp;&amp; v):v_(std::forward&lt;T&gt;(v))
      {
          std::cout &lt;&lt; "building Foo..\n";
      }
  };
  
  
  int main()
  {
      int v;
      Foo&lt;int&gt; foo(v);
  
      std::cin.ignore();
  }
  </code></pre>
  
  <p>visual c++ 2010 output :</p>
  
  <blockquote>
    <p>error C2664: <code>'Foo&lt;T&gt;::Foo(T &amp;&amp;)'</code> : cannot convert parameter 1 from <code>'int'</code> to <code>'int &amp;&amp;'</code></p>
  </blockquote>
  
  <p>Is it normal that I can't bind a lvalue to a rvalue reference ?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>same thing for a function :</p>
  
  <pre><code>void f(int &amp;&amp; v)
  {
  
  }
  int v;
  f(v); //won't compile
  </code></pre>
  
  <p>I'm a little bit confused because I think std::forward is usefull to detect if a method is called with a lvalue or a rvalue reference.
  But it seems that we can't bind any lvalue into rvalue reference... at least without template parameter but I don't understand it very well</p>