I was wondering why dynamic arrays creation is possible using unique_ptr but not possible using shared_ptr?
unique_ptr<int[]> ptr1(new int[n]); /// OK! shared_ptr<int[]> ptr2(new int[n]); /// Incorrect
Aucun commentaire:
Enregistrer un commentaire