Is the result of a cast an rvalue?
问题 Let int a = 0; Then is (int)a an rvalue in standard C++? Different compilers show different results for this code: #include <iostream> using namespace std; void f(int& x) { cout << "l value" << endl; } void f(int&& x) { cout << "r value" << endl; } int main() { int a = 0; f((int)a); } compilers with different results: 1) http://cpp.sh/2r6 2) http://webcompiler.cloudapp.net/ 回答1: The should be an rvalue but webcompiler is running Visual Studio and Visual Studio has an extension which allows