Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 1.78 KB

File metadata and controls

62 lines (47 loc) · 1.78 KB
title Destructible
cppdoc
revision
since
C++11

import { DR, DRList } from "@components/defect-report"; import { Desc, DescList } from "@components/desc-list"; import Missing from "@components/Missing.astro"; import { Revision, RevisionBlock } from "@components/revision";

Specifies that an instance of the type can be destructed.

Requirements

The type T satisfies Destructible if

Given

  • u, an expression of type T.

  • u, an lvalue expression of type Key.

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

`std::is_destructible` `std::is_trivially_destructible` `std::is_nothrow_destructible` checks if a type has a non-deleted destructor `destructible` specifies that an object of the type can be destroyed