-Wlifetime标志的目的是什么? [英] the purpose of the -Wlifetime flag?

查看:82
本文介绍了-Wlifetime标志的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

中的 -Wlifetime 编译标志的用途是什么?

What is the purpose of the -Wlifetime compile flag in clang?

我在Internet上发现的有关信息非常模糊。

The information I found on the Internet about it are very vague. Is this any noticeable feature?

推荐答案

此标志分析本地文件以查看代码是否可以使用指向已死对象的指针。
您可以在YouTube上看到Herb Sutter cppcon视频,他的解释很好: https://youtu.be/80BZxujhY38

This flag analyzes the local file to see if the code may use pointers to objects that are dead. You can see Herb Sutter cppcon video on YouTube where he explains this very well: https://youtu.be/80BZxujhY38

这篇关于-Wlifetime标志的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆