There are cases where you must provide a pointer to an instance of a C++ class but you need to prevent the object from being destroyed via operator delete.
The preferred approach is to make the class destructor either protected or private. Doing this will cause the compiler to generate an error when calling delete on any class instance.
A second way to prevent deletion is to overload operator delete at the class level and provide either no implementation or an empty implementation. In the former case, a compiler error will occur when attempting to call delete. If you take this overloading approach, you must also be sure to overload operator new as well lest you accidentally allow for the creation of undeleteable objects!
This last technique is best with a class that is not designed to be dynamically constructed, but rather declared as a global, class static or stack variable. It can also be employed when compatibility with existing templates is needed.