When is a C++ destructor called?
1) If the object is created via a pointer and that pointer is later deleted or given a new address to point to, does the object that it was pointing to call its destructor (assuming nothing else is pointing to it)? It depends on the type of pointers. For example, smart pointers often delete their … Read more