Just a quick query regarding shared_ptr
:
so i have this code:
std::shared_ptr<int> asd(new int[10]);
From my understanding, i am making a single shared_ptr<int>
that points to an array of 10 integers.
if my understading is correct then here are my questions:
1.) How do i access the values/initialize ?
2.) Is it possible to use make_shared?
3.) What if i want to make an array of 10 shared_ptr and make them point to a single int?
I am also aware that i need to supply a custom deleter when i deal with arrays using shared_ptr. Using vectors will also make it easier.