命名空间
变体
操作

std::destructible

来自 cppreference.cn
 
 
 
定义于头文件 <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]

[编辑] 另请参阅

检查类型是否具有非删除的析构函数
(类模板) [编辑]
English 日本語 中文(简体) 中文(繁體)