Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我之前的问题(为什么在 lambda 中通过引用捕获的值被破坏?)答案是“因为您访问超出范围的变量的内存”。
在最常见的编译器(我的意思是Visual C++、gcc和clang)中是否存在关于这种不正确内存访问的编译器警告?
一般来说?不,这样做很难。他们不能。