当前位置:网站首页>d的破坏与安全
d的破坏与安全
2022-06-22 13:08:00 【fqbqrr】
原文
因为use包含destroy,所以不能为安全
R use(R, T)(T obj, R delegate(T) fT)
{
scope (exit)
destroy!false(obj);
return fT(obj);
}
如何确保安全调用destroy?
只要调用它的析构器是@safe的,destroy就应是安全的.
如果析构器是@system,则安全调用代码唯一方法是:(1)确保不违反内存安全调用析构器条件,(2)(用编译时和/或运行时检查)确保满足这些条件,(3)在@trusted函数中包装destroy.
use推导为系统,闭包也未标记为安全.
标记use为安全,来看看说了啥.
对类,当前dmd+druntime不能静态决定析构器是否安全.
边栏推荐
- 数据库中如何使用SQL进行修改&删除
- 别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
- Query escape in Oracle expdp export
- SQL Server 常用函数
- 芯片硅片与流片技术
- How to add a mask to a VR panoramic work? What is the function?
- 浅析Redis 切片集群的数据倾斜问题
- Summary of patent blog writing
- 论文专利博客写作总结
- In 5g era, how to create an amazing live VR activity?
猜你喜欢
随机推荐
论文专利博客写作总结
Nansen Annual Report
History of hash index design
微服务测试效率治理
unity防止按钮btn被连续点击
Instanceinforeplicator class of Eureka (service registration auxiliary class)
Technology practice | scene oriented audio and video call experience Optimization
请问,中衍期货是不是靠谱的?资金安全吗?
Run sqoop1.4.5 to report warning: does not exist! HCatalog jobs will fail.
芯片硅片与流片技术
My suggestions on SAP ABAP transformation
Interpretation of the paper -- scalable collaborative filtering with jointly derived neighborhood interpolation weights
Growth knowledge network
如何保护WordPress网站免受网络攻击?采取安全措施至关重要
MySQL如何让一个表中可以有多个自增列
能让Jellyfin直接挂载阿里云盘的aliyundrive-fuse
Aliyundrive fuse that allows jellyfin to directly mount alicloud disks
What does Huawei's minutes on patents say? (including Huawei's top ten inventions)
Traffic replication in istio Service Grid
Maui uses Masa blazor component library








