User Tools

Site Tools


destructor

Destructor

Return to Constructor

destructor - a special member function of a class (e.g., S) declared using the same name as the class but preceded by a tilde character (e.g., ~S) that is invoked implicitly when the lifetime of an object of that type ends on leaving the block in which the object was defined (automatic storage duration), when the main function returns (static storage duration), when the thread for which it is defined ends (thread storage duration), when the delete operator is applied (dynamic storage duration), or when the destructor is invoked explicitly within the program. Note that a class’s destructor automatically invokes the destructors for each of its nonstatic data members and base-classs objects. Generalized PODs ’11 (450), Rvalue References (752), noexcept Specifier (1086)” (EMCppSfe 2021)

destructor.txt · Last modified: 2022/03/21 03:29 by 127.0.0.1