mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 20:54:39 +03:00
@@ -317,8 +317,8 @@ void foo() {
|
||||
}
|
||||
```
|
||||
|
||||
由于 int& 不能引用 double 类型的参数,因此必须产生一个临时值来保存 s 的值,
|
||||
从而当 increase() 修改这个临时值时,从而调用完成后 s 本身并没有被修改。
|
||||
由于 `int&` 不能引用 `double` 类型的参数,因此必须产生一个临时值来保存 `s` 的值,
|
||||
从而当 `increase()` 修改这个临时值时,从而调用完成后 `s` 本身并没有被修改。
|
||||
|
||||
第二个问题,为什么常量引用允许绑定到非左值?原因很简单,因为 Fortran 需要。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user