dynamic_pointer_cast () support for SharedPtr<>