Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 564 Bytes

13.9.md

File metadata and controls

11 lines (6 loc) · 564 Bytes

What is a destructor?

A destructor is a member function with the name of the class prefixed by a tilde (~) and has no return value and takes no parameters.

What does the synthesized destructor do?

The synthesized destructor disallows objects of the type from being destroyed for some classes. Otherwise, it has an empty function body and the members are automatically destoryed after the empty destructor body is run.

When is a destructor synthesized?

The compiler defines a synthesized destructor for any class that does not define its own destructor.