It is often not recommended to use pointers. However, if I have a data member pointing to or referencing to an expensive object for which this data member doesn't have ownership, and this data member can not be initialized during construction(i.e., make this data member a reference is not a choice).
What better options are there than making it a pointer?
And if I make this data member a pointer, do I still need to write my own copy, assignment constructor and destructor?
Aucun commentaire:
Enregistrer un commentaire