FAQ 12.18 Is it legal (and moral) for a member function to say delete this?Yes, but be careful. Programmers usually have a hard time emotionally accepting that this is valid, probably because it seems as if the member function is inside the object and deleting the object during a member function seems strange. But with care, this technique can be perfectly safe. Here is how we define "with care."
|