update: [[safe c++]] has a concise argument that if ctor is allowed to throw exception, then it’s possible to have dtor skipped accidentally. Only an empty dtor can be safely skipped.
This is typical of c++ — destructor (dtor) is one of the most important features but quite tricky beneath the surface
* dtor sequence – DCBC
* virtual dtor
* synthesized dtor is usually no good if there’s any pointer field
* lots of undefined behaviors
* there are guidelines for dtor in a base class vs leaf class — never mindless
* objects put into containers need a reasonable dtor
* when the best practice is to leave the dtor to the compiler, you could look stupid by writing one, esp. in an interview.
* smart pointer classes is all about dtor
* RAII is all about dtor
* interplay with delete
*** placement new, array-delete vs delete
*** override operator delete
*** ownership !