有谁知道,为什么下面的代码没有发出警告?
struct Foo
{
int a = 1;
};
struct Bar
{
Foo getString()
{
return Foo();
}
};
int main()
{
Bar a;
const Foo& b = a.getString(); <--- Foo getString() becomes Foo&?
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
39 次 |
| 最近记录: |