Destructible

C++ concepts: Destructible

Specifies that an instance of the type can be destructed.

Requirements

The type T satisfies Destructible if.

Given.

  • u, a expression of type T

The following expressions must be valid and have their specified effects.

Expression Post-conditions
u.~T() All resources owned by u are reclaimed, no exceptions are thrown.

Notes

Destructors are called implicitly at the end of object lifetime such as when leaving scope or by the delete-expression. Explicit destructor call as shown in the type requirement table is rare.

Thanks to pseudo destructor call, all scalar types meet the requirement of Destructible, while array types and reference types do not. Note that std::is_destructible allows arrays and reference types.

See also

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

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/concept/Destructible

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部