Recently I came accross a class containing a unique pointer member variable. In the constructer it was initialized with make_unique and in the destructer it was cleared with reset. I know that make_unique performs a heap allocation. Is there any reason for this overhead ? Why not use a "normal" member variable.
Aucun commentaire:
Enregistrer un commentaire