Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
//using customized deleter
shared_ptr<Dog> pSD(new Dog[3], [](Dog *p){delete []p;});
//for unique pointer, we do not need customized deleter.
//Need to indicate it in template parameter: unique_ptr<Dog[]>.
unique_ptr<Dog[]> dogs(new Dog[3]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment