title: T&& in templated function and class
body: <p>I've just stumbled upon that <code>T&amp;&amp;</code> in class and function means different things.<br>
  In function:</p>
  
  <pre><code>template&lt;class T&gt; void f(T&amp;&amp; t){};   // t is R or L-value
  ...
  int i=0; 
  f(i);   // t in f is lvalue
  f(42);  // t in f is rvalue  
  </code></pre>
  
  <p>In class:</p>
  
  <pre><code>template&lt;class T&gt; 
  struct S { 
         S(T&amp;&amp; t){}  // t is only R-value? 
  };
  ...
  int i;
  S&lt;int&gt; ss(i);   // compile error - cannot bind lvalue to ‘int&amp;&amp;’
  </code></pre>
  
  <p>Does this means that if we have<code>T&amp;&amp; t</code> in class, than <code>t</code> will be only rvalue?<br>
  Can some one point me where I can get more info about this?<br>
  Does it means that I need to write two method overloads for L and R-values? </p>
  
  <p><strong>ANSWER</strong><br>
  As Alf's example shows, <code>t</code> in function and class can be Lvalue or Rvalue.   </p>