Is there any truth to this claim? It seems like, if true, C++ truly lacks a good smart pointer in this case and it should be best to stick to custom ones or perhaps the one in boost is better?
I think this simulates new/delete semantics with a dangling pointer
check. Yes, it is not pretty, and shared_ptr does not have a detach().
But worse, it does not work (just like plain new/delete does not) in
the case of two objects A and B, where, if one is destroyed, it should
destroy the other with it. If both in their destructors call destroy,
and one of the objects gets destroyed from the outside, infinite
recursion occurs: A dtor runs -> destroys reference to B -> B dtor runs
-> destroys reference to A -> ...