首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Destructible

指定可以解构该类型的实例。

所需

类型T满足Destructible如果。

给予。

  • u,类型的表达式T

下列表达式必须有效并具有指定的效果。

Expression

Post-conditions

u.~T()

All resources owned by u are reclaimed, no exceptions are thrown.

注记

的末尾隐式调用析构函数。对象寿命比如离开的时候范围或由删除-表达式显式析构函数调用(如类型要求表中所示)非常少见。

感谢伪析构调用,所有标量类型都满足Destructible,而数组类型和引用类型不。请注意std::is_destructible允许数组和引用类型。

另见

is_destructibleis_trivially_destructibleis_nothrow_destructible (C++11)(C++11)(C++11)

checks if a type has a non-deleted destructor (class template)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com