Click here to Skip to main content
15,887,683 members

Comments by Wang Xin USTC (Top 2 by date)

Wang Xin USTC 12-Oct-13 10:44am View    
well ,thank you.
what I intended to ask is :

void foo(int&& i);
int j = 11;
foo(j); // error because try to bind a rvalue ref to an lvalue.

but when it comes to template function, as in the initial question ,things changed. that is my point.
Wang Xin USTC 12-Oct-13 10:09am View    
yes,I know from debugging the code that T is deducted as int& ,but I'd like to know what happened behind the scenes : why here we are allowed to bind a rvalue reference to a lvalue?