命名空间
变体
操作

std::destructible

来自 cppreference.cn
< cpp‎ | concepts
定义于头文件 <concepts>
template< class T >
concept destructible = std::is_nothrow_destructible_v<T>;
(自 C++20 起)

概念 destructible 规定了所有类型(包含引用类型)的实例在其生命周期结束时可以安全销毁的概念。

[编辑] 注解

Destructible 具名要求不同,std::destructible 要求析构函数为 noexcept(true),而不仅仅是被调用时非抛出,并且允许引用类型和数组类型。

[编辑] 参考

  • C++23 标准 (ISO/IEC 14882:2024)
  • 18.4.10 概念 destructible [concept.destructible]
  • C++20 标准 (ISO/IEC 14882:2020)
  • 18.4.10 概念 destructible [concept.destructible]

[编辑] 参见

检查类型是否拥有非删除的析构函数
(类模板) [编辑]