You only need to free what you select. new must match delete , and new[] matches delete[] .
If you do not do this, the class itself should not require another from you. And yes, the standard library behaves well.
No, you donโt have to do anything. Let the std::string instance clear after itself. (And of course, follow his lead and make sure your own classes do the same)
source share