One solution to this problem is the idea of a smart pointer. A smart pointer is an object that contains a pointer to another object, but does additional operations that regular C++ pointers don't do. Our smart pointer would perform two important functions. First, when asked to compare itself with another instance, it would actually access the pointed-to objects and compare their contents. Second, it would keep track of how many other smart pointers are referencing it, so that it can delete the object it's pointing to when no one else needs it anymore.
By doing these two things we eliminate the drawbacks of using pointers, but introduce some additional complexity into the design.
So here is how it works: Wherever you would have declared a variable of type
Configuration *cp( new .... );
you now declare its type as
ConfigurationPointer cp( new .... );
It's as "simple" as that! The essence of such a class has been written for you. It can be found in