passing rvalue raises cannot bind to lvalue
<p>The program is as below:</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

template &lt;typename F, typename T1, typename T2&gt;
void flip2(F f, T1 &amp;&amp;t1, T2 &amp;&amp;t2)
{
      f(t2, t1);
}

void g(int &amp;&amp;i, int &amp;j)
{
      cout &lt;&lt; i &lt;&lt; " " &lt;&lt; j &lt;&lt; endl;
}

int main(void)
{
      int i = 1;
      flip2(g, i, 42);
}
</code></pre>

<p>The compiler complains:</p>

<pre><code>error: rvalue reference to type 'int' cannot bind to lvalue of type 'int'
</code></pre>

<p>But to my understanding, as <code>T2</code> is instantiated with <code>int</code>, then the type of <code>t2</code> is <code>int&amp;&amp;</code>, so it should be allowed to pass to function <code>g</code>'s first argument (<code>int &amp;&amp;</code>).</p>

<p>What's wrong with my understanding?</p>