Why unique_ptr and shared_ptr do not invalidate the pointer they are constructed from?
问题 A note: this is an API design question , riding on the design of the constructors of unique_ptr and share_ptr for the sake of the question, but not aiming to propose any change to their current specifications. Though it would usually be advisable to use make_unique and make_shared , both unique_ptr and shared_ptr can be constructed from a raw pointer. Both get the pointer by value and copy it. Both allow (i.e. in the sense of: do not prevent ) a continuance usage of the original pointer