int &a = 1;//报错,引用需要一个合法的内存空间 const int & a = 1;//正确,类似于int temp = 1; const int & a = temp;
const int & a = 1;
原文:https://www.cnblogs.com/zzdbullet/p/14886504.html