std:: destructible
From cppreference.net
C++
Concepts library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||
|
定义于头文件
<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]
-
18.4.10 概念
- C++20 标准 (ISO/IEC 14882:2020):
-
-
18.4.10 概念
destructible[concept.destructible]
-
18.4.10 概念
参见
|
(C++11)
(C++11)
(C++11)
|
检查类型是否拥有未被删除的析构函数
(类模板) |