In all other cases, the shared_ptr acquires ownership of p with a use count of1, and -optionally- with del and/or alloc as deleter and allocator, respectively.
Additionally, a call to this function has the same side effects as if shared_ptr's destructor was called before its value changed (including the deletion of the managed object if this shared_ptr was unique).
参数
p
Pointer whose ownership is taken over by the object. Generally, this pointer should not be already managed by any other managed pointer (i.e., this value should not come from calling member get on a managed pointer). U*shall be implicitly convertible toT*(whereT是shared_ptr的模板参数)。
del
Deleter object to be used to release the owned object. This shall be a callable object taking a pointer toTas argument for its functional call (whereT是shared_ptr的模板参数)。
alloc
Allocator object used to allocate/deallocate internal storage.