You clear your clutter, and the standard library clears your clutter. The memory that std :: string allocates is a mess.
The default behavior of a destructor is to call destructors for each database and data item. Your string is a data member, so its destructor is called. Its destructor does everything that needs to be done here, so it is no longer necessary (and it would actually be very wrong) to clear anything here than if you had a line as a local variable in main ().
source share