It is mentioned in Scott Meyer's book that part of the overhead caused by using shared pointers is that they need virutal function to destroy the pointed object correctly. My question is why? Is this not supposed to be the reponsibility of the class of that pointed object to have a virtual destructor?
Aucun commentaire:
Enregistrer un commentaire