Please consider the following code:
class foo { public: foo(){} ~foo(){} void done() { delete this;} private: int x; };
What is
Calling delete this is a bad idea. Whoever calls new should call the delete. Hence the problems as highlighted in the other responses.
delete this
new
delete
Also you can have memory leaks/undefined behaviour when construcing an array of objects.