Respuesta :

The answer is smart pointers. Smart pointers are wrappers for raw pointers or as I like to call them dumb pointers.

In C++, it is guaranteed that the deconstructor will be called when the object goes out of scope.