Deleting an object in C++
Isn’t this the normal way to free the memory associated with an object? This is a common way of managing dynamically allocated memory, but it’s not a good way to do so. This sort of code is brittle because it is not exception-safe: if an exception is thrown between when you create the object and … Read more