I am experimenting with overloading operator delete, so that I can return a plain pointer to those who don\'t wish to work with smart pointers, and yet be able to control wh
operator delete
calls the object destructor and after that you are in no man's land. As others pointed out, what you are trying to do is not possible.
What you are doing is also a bit dodgy in the way of inconsistent behaviour when the object is constructed on the heap and on the stack.
With your idea to override operator delete
the object will stay alive depending on some internal logic (the number of lives has reached 9) if constructed using new.
When constructed on the stack (Cat cat("Chesire cat");
) the object will always get destructed when it goes out of scope. In order to achive what you are trying to do you will also need to change the bahaviour of the destructor to "stop destructing". This is not possible, also for very good reasons.
So, if you want ref counting, just implement your own mechanism. After all, you can't call yourself a C++ programmer if you haven't done your own ref count memory management at least once :))