码:
void test(int&& a) { a++; std::cout << a << std::endl; }
并执行:
test(0);
为什么输出1?因为我认为0是右值,它无法改变.
c++ rvalue lvalue
c++ ×1
lvalue ×1
rvalue ×1