and if it does what behavior should object [ppPx] exhibit on destruction?
The immediate pointer will be deleted, but not the object at the end of the reference chain.
should it delete the underlying object pointed to by the pointer that points to it?
Should it? No. The class has no way of knowing if the object that the pointer points to is on the stack or on the heap. It doesn't even know if the object it was assigned is on the heap; it just assumes it is.
usually pointers to pointers should not be deleted.
Usually pointers to pointers are a bad idea. Smart pointers to pointers to pointers are never a good idea.
Since shared pointers delete memory when it goes out of scope, it attempts to delete an object that was allocated on the stack, which in turn crashes your program.
i was aware of these facts and wanted to get validation that i was not overlooking my understanding that shared_ptr with pointer to pointer doesn't make sense in that i may be using it incorrectly w.r.t. pointer to pointer.
just to add to your point helios:
The immediate pointer will be deleted
i get your associated point about attempting to treat stack as part of heap and understand your attempting to create a pointer to a pointer heap based style by your snippet:
however, this is also incorrect - but i get what you are attempting to do and my point is that using smart_ptr for pointers to pointers are never a good idea as you pointed out.
so even though pointers to pointers are a bad idea in first place i just would like to add it as one more item that smart pointers cannot cater for i.t.o raw pointers.
The problem is, uses for pointers to pointers are replaced by containers and references. So, I am not aware of any valid use for pointers to pointers in C++11.
I think that it's good that C++ gives you the choice to use pointers, or not use them, whatever you want to do. There is always that rare use case, but the important thing is that if you don't want to use pointers in c++, there are many good alternatives that give you all the advantages of raw pointers without some of the disadvantages.