小编Raf*_*dal的帖子

从常量引用初始化非常量引用

int main(){   
  int x = 10;
  const int&z = x;
  int &y = z; // why is this ill formed?
}
Run Code Online (Sandbox Code Playgroud)

为什么初始化非常量引用int到常量引用不正确?这背后的原因是什么?

c++ reference

4
推荐指数
1
解决办法
228
查看次数

标签 统计

c++ ×1

reference ×1