c++ 右值引用

 

 

 

 

右值引用 自己本身是一个左值


 

 

 

#include <iostream>

void test(int& x) {
    std::cout << "ttttt22222\n";
}

void test(int&& x) {
    std::cout << "ttttt1111111\n";
}


int main()
{
    int a = 10;
    test(a);
    //test(std ::move(a));
}   

 

posted @ 2024-03-04 22:31  AngDH  阅读(8)  评论(0)    收藏  举报