In C++, it is a good practice to evaluate if the passed instance is exactly itself at the very beginning of defining a operator= method:
There is still a flaw in the above implementation. If an exception occurs at pc=new PriceCalculaotr(*rhs.pc), the memoryof the original pc has been emptied. To fix this, never clear the data of the pointers too early.