This question already has an answer here:
- Uses of destructor = delete; 5 answers
i have known that a destructor which is declared as delete could not used as
A a;
but could be used as
A*a =new a();
but we could not free the memory by using
delete a;
so when is it recommended or prefered to declare a destructor as deleted?Is there an idiom?
Aucun commentaire:
Enregistrer un commentaire