The title may not be very clear, let me explain: I just want to display a message when a string is destroyed, so I did that:
std::string::~std::string(void)
{
std::cout << "Destroyed string" << std::endl;
}
It didn't compile, then I tried this:
namespace std
{
string::~string(void)
{
cout << "Destroyed string" << endl;
}
}
And it also didn't work, so is there a way to do what I want to do? Thanks for any help.