只是一定要很好地理解什么是引擎盖下...问题是在代码中评论移动语义和变量终身绑定时左值右值来引用
void test(int && val)
{
val=4;
}//val is destroyed here ?
int main()
{
int nb;
test(std::move(nb));
//undefined behavior if I reference here nb ?
std::cout << nb;
nb=5;
std::cin.ignore();
}
'void main()'... –