- You can only call std::dynamic_pointer_cast on shared_ptr. For unique_ptr, you need to dynamic_cast its raw pointer and create a new unique_ptr with it and manully release the base pointer if the cast succeeds.
- std::move won’t temporarily increase refcount, but dynamic_pointer_cast will since it returns a new shared_pointer.
- refcount is a pointer in shared_ptr.
- shared_ptr of different types can share the same object (i.e. pointers pointing to the same obj, and refcount also points to the same one). Especially when you create shared_ptr with dynamic_cast