void abc(int &a)
{
std::cout <<"abc1:"<< a << std::endl;
}
void abc(int &&a)
{
std::cout <<"abc2:"<< a << std::endl;
}
int main()
{
abc(1);
int a = 1;
abc(a);
}
输出
abc2:1
abc1:1
标签:std,abc,cout,右值,int,void,c++,Linux
来源: https://www.cnblogs.com/zhaogaojian/p/16395806.html